Code Monkey home page Code Monkey logo

next-compile-node-modules's People

Contributors

fsdiogo avatar ivolimasilva avatar ruimonteiro93 avatar satazor avatar threequartersjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

next-compile-node-modules's Issues

Improve coverage

There's some istanbul ignore lines, remove them and add tests for them.

Not defining `exclude` property breaks the webpack configuration

What's happening

When using withCompileNodeModules without the exclude key defined, or without arguments, the webpack doesn't accept the configuration.

Screenshot 2020-02-05 at 12 25 24

Possible issue

From what I can gather, in order to combine the exclude defined in the options object and the default configuration, we do this:

exclude: [
  ...toArray(ruleOptions.exclude),
  // Next.js >= v9.1.5 is now inlining statements through `babel-plugin-transform-define`, see https://github.com/zeit/next.js/blob/d64587e1a3af11411a6c458ae9544950dfba7825/packages/next/build/webpack/loaders/next-babel-loader.js#L185
  // However, the `process.browser` inlining was causing problems with Webpack builtin
  // `node-libs-browser` (mock) and `node-process`
  /[\\/]node_modules[/\\](node-libs-browser|process)[/\\]/,
],

However, if exclude is not defined in the options object, we will be spreading an array [undefined], which will cause the first element of the array in the final exclude option to be undefined, causing the webpack process to fail.

We need to change this to a conditional spread.

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.