Giter VIP home page Giter VIP logo

Comments (6)

pierre-b avatar pierre-b commented on August 12, 2024

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.jsconfig 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.

pierre-b avatar pierre-b commented on August 12, 2024

I guess the node_modulesfolders are excluded from the parsers to boost the build process, however it looks like a hack to tune it with a dev.config.jsfile.

@eliperelman don't you think it would be nice to control the excluded folders from the config in package.json?

from neo.

eliperelman avatar eliperelman commented on August 12, 2024

@pierre-b could you confirm if this is still an issue with 2.4.0?

from neo.

pierre-b avatar pierre-b commented on August 12, 2024

Is there any performance downside to not exclude node_modules from the parsers?

from neo.

pierre-b avatar pierre-b commented on August 12, 2024

@eliperelman the json parsing is no more an issue with 2.4.0

from neo.

eliperelman avatar eliperelman commented on August 12, 2024

I think this is resolved, please re-open if still an issue.

from neo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.