Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aurelia CLI run webpack task assumes config.entry.app exists #1144

Open
JSeligsohn opened this issue Aug 19, 2019 · 1 comment
Open

Aurelia CLI run webpack task assumes config.entry.app exists #1144

JSeligsohn opened this issue Aug 19, 2019 · 1 comment

Comments

@JSeligsohn
Copy link

JSeligsohn commented Aug 19, 2019

I'm submitting a bug report

  • Library Version:
    Aurelia CLI 1.0.2

Please tell us about your environment:

  • Operating System:
    OSX 10.14|

  • Node Version:
    8.9..0

  • NPM Version:
    5.5.1
  • Browser:
    all

  • Language:
    all

  • Loader/bundler:
    Webpack

Current behavior:
I want to change the name of the entry point in webpack.config.js from

entry: {
    app: ['aurelia-bootstrapper']
  }

to

entry: {
    'admin-app': ['aurelia-bootstrapper']
  }

This is so that in output I'm able to redefine what [name] is:

output: {
    path: outDir,
    publicPath: baseUrl,
    filename: '[name].bundle.js',
    sourceMapFilename: '[name].bundle.map',
    chunkFilename: '[name].bundle.js',
  },

This works, such that I'd get admin-app.bundle.js, however, when I do "au run", I get an error: TypeError: Cannot read property 'unshift' of undefined
This appears to be related to aurelia_project/tasks/run.ts assuming the entry point is found at config.entry.app (line 32 and 35). However, by specifying it as 'admin-app' in webpack.config.js, there is no such property "app" in config.entry.

  • What is the expected behavior?

I should be able to rename the entrypoint to admin-app such that the scripts reflect that name, and "au run" should work without errors. Ideally there should be a way to specify the name/entry point in aurelia_project/aurelia.json

  • What is the motivation / use case for changing the behavior?
    I would like to namespace my scripts in an easy, convenient way, since I maintain multiple aurelia projects and serve the scripts from a CDN. Not all of my projects can reference the same app.bundle.js file.
@3cp
Copy link
Member

3cp commented Aug 19, 2019

Next release version will soon get rid of complex run task. It will be only webpack.config.js controlling the webpack experience. #1137

We are waiting to finalise another PR before release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants