aurelia / cli

The Aurelia 1 command line tool. Use the CLI to create projects, scaffold components, and bundle your app for release.
MIT License
407 stars 133 forks source link

webpack.netcore.config.js should pass environment/arguments to webpack.config #1163

Open alexisszabo opened 4 years ago

alexisszabo commented 4 years ago

I'm submitting a bug report

Current behavior:

Generating a new aurelia project using webpack and .net core produces a webpack.netcore.config.js file that does not pass environment variables or arguments to webpack.config

The webpack.netcore.config.js should change from this (only relevant portions shown):

const webpackConfig = require('./webpack.config');
var originalConfig = webpackConfig({});

module.exports = () => {
  let config = originalConfig;

to this:

const webpackConfig = require('./webpack.config');

module.exports = (env, argv) => {
  let config = webpackConfig(env, argv);

so that environment variables and arguments are passed.

3cp commented 4 years ago

The .net config is definitely overlooked when we refactor our webpack setup where we change webpack config file quite a lot.

If you would like to create a PR on all the fix around .net, @Sayan751 and I can help review it. Thanks!

Sayan751 commented 4 years ago

I left a comment in #901. I think these issues are somewhat related.

alexdresko commented 4 years ago

@Sayan751 Could you please please please share a demo project that works for both development and production builds? I'm having SO much difficulty getting this right.

Sayan751 commented 4 years ago

@alexdresko Know what? Share you non-working repo with me instead. It will help me with a starting point :)

alexisszabo commented 3 years ago

The .net config is definitely overlooked when we refactor our webpack setup where we change webpack config file quite a lot.

If you would like to create a PR on all the fix around .net, @Sayan751 and I can help review it. Thanks!

Apologies. I ended up removing .net completely from my project, and moving to the cli-bundler, so didn't get around to making a PR for this.