neutrinojs / neutrino

Create and build modern JavaScript projects with zero initial configuration.
https://neutrinojs.org
Mozilla Public License 2.0
3.95k stars 213 forks source link

Issue: alias and config externals #1623

Closed soyjavi closed 8 months ago

soyjavi commented 4 years ago

issue

Please try to answer the following questions:

neutrino.config.resolve.alias.set('@aurora', path.resolve(__dirname, './node_modules/@lookiero/aurora/web'))

then i setup the external

neutrino.config.when(process.env.NODE_ENV === 'production', (config) => {
  config.externals([
    '@aurora',
  ]);
});
constgen commented 4 years ago

You probably mean Neutrino 9.4.0 and not 4.9.0

Neutrino just outputs a Webpack config. You can console.log(module.exports) in webpack.config.js to check if it matches your expectations. If it does then it is an issue in the configuration logic, not the Neutrino.

edmorley commented 4 years ago

You can console.log(module.exports) in webpack.config.js to check if it matches your expectations

Printing the object directly works for some parts of it, but others will be a bit quirky. For the most accurate (and annotated) output, I'd use: https://neutrinojs.org/usage/#inspecting-the-generated-webpack-config

constgen commented 4 years ago

@edmorley It works. But I had problems with visualizing configs in my project caused by extremely huge ESLint config that is a part of Webpack loader. So I decided to go with default console behavior - only several levels nested objects are shown