Comments (6)
Found out the webpack core config prevents the webpack "json-loader" to parse the "node_modules" and "bower_components" folders.
For others who might encounter a similar error, here is how to deal with it with a dev.config.js
config file:
const dev = require('mozilla-neo/config/webpack.dev');
const { join } = require('path');
const ContextReplacementPlugin = require('webpack').ContextReplacementPlugin;
// http://stackoverflow.com/questions/25384360/how-to-prevent-moment-js-from-loading-locales-with-webpack
// dev.plugins.push(new IgnorePlugin(/^\.\/locale$/, /moment$/));
dev.plugins.push(new ContextReplacementPlugin(/moment[\/\\]locale$/, /en/));
dev.module.loaders[2].include.push(join(process.cwd(), '/node_modules/moment-timezone'));
dev.module.loaders[2].exclude = /((node_modules\/(?!moment-timezone))|bower_components)/;
module.exports = dev;
from neo.
I guess the node_modules
folders are excluded from the parsers to boost the build process, however it looks like a hack to tune it with a dev.config.js
file.
@eliperelman don't you think it would be nice to control the excluded folders from the config in package.json
?
from neo.
@pierre-b could you confirm if this is still an issue with 2.4.0?
from neo.
Is there any performance downside to not exclude node_modules
from the parsers?
from neo.
@eliperelman the json parsing is no more an issue with 2.4.0
from neo.
I think this is resolved, please re-open if still an issue.
from neo.
Related Issues (20)
- move repository to mozilla organization HOT 1
- auto release when creating a tag
- Simplify app.js
- index.html built with npm run build does not show html elements HOT 6
- neo init causes a bug HOT 4
- hide right side state panel HOT 1
- Integrate webpack-dashboard HOT 2
- Support compiling with Node.js versions before v6 HOT 3
- neo test results in build errors (JSON files) HOT 2
- Server side rendering? HOT 1
- Disable devtools HOT 2
- Serving assets with the dev server HOT 5
- Save 1.1Mo in the production build HOT 2
- Add support for Jest tests HOT 1
- FlowStatusPlugin doesn't print flow status checks HOT 7
- Add `src/` directory to webpack resolve root config
- Switch Neo to be a neutrino preset, or deprecate in favor of neutrino-preset-react HOT 1
- unable to npm install HOT 2
- CODE_OF_CONDUCT.md file missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neo.