babelInclude on a symlink folder does not work
See original GitHub issuei have an external component folder linked to my web project through npm-link. on my web project i have configured config-override to babel parse the npm-linked folder withe the proper plugin.
this works well when not using npm link and simply downloading from npm when using npm-link i get errors related to not using “babel/plugin-proposal-class-properties”
tried also replacing:
path.resolve(‘node_modules/@blio’),
with
fs.realpathSync(‘node_modules/@blio’)
and it didn’t help either
i am using: “react-scripts”: “3.0.0”, “customize-cra”: “^0.2.14”,
const { override, fixBabelImports, addBabelPlugin, babelInclude, addLessLoader } = require('customize-cra');
const path = require('path');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: { '@primary-color': '#047fff' },
}),
addBabelPlugin('@babel/plugin-proposal-class-properties'),
babelInclude([
path.resolve('src'), // don't forget this
path.resolve('node_modules/@blio'),
]),
);
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
The create-react-app imports restriction outside of src directory
Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's...
Read more >webpack/webpack - Gitter
I'm trying to run some es6/react tests with karma, however my webpack.config.js is using { test: /\.jsx?$/, loaders: ['babel'], include: ...
Read more >[Solved]-Babel loader crashing npm build-babel.js
And then add a .babelrc file to your directory and fill it with the ... Babel install does not work through npm ·...
Read more >Sharing source code and libraries in React - Medium
Create a simple shared component in the shared-lib src folder. Run ... For some reason symlinks don't work as expected, but fortunately Mike ......
Read more >teambit - Bountysource
The problem is that if a file is added, there is no process that symlinks it to ... component to some other project...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Life saver! Only one note for future visitors, it’s
fs.realpathSync
(see casing).Thanks so much @royair
Thanks Mark, I’ve found a workaround: using fs.realPathSync instead of Path.resolve