Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Custom webpack.config.js hangs build #290

Closed
rapropos opened this issue Oct 31, 2016 · 8 comments
Closed

Custom webpack.config.js hangs build #290

rapropos opened this issue Oct 31, 2016 · 8 comments
Assignees
Labels

Comments

@rapropos
Copy link

Short description of the problem:

Even without modifying, simply specifying a custom webpack configuration file causes both prod and dev builds to hang after apparent completion.

What behavior are you expecting?

Build process to indicate completion and return to shell.

Steps to reproduce:

  1. ionic start --v2 scratch
  2. cd scratch
  3. cp node_modules/@ionic/app-scripts/config/webpack.config.js ./
  4. Modify scripts.build in package.json to read "ionic-app-scripts build --dev -w ./webpack.config.js" (--dev is optional, same issue happens without it)
  5. npm i --save-dev @ionic/app-scripts/@0.0.39 (also optional, 0.0.38 has same problem)
  6. ionic build(hangs after build dev finished)

Which @ionic/app-scripts version are you using?

0.0.38, 0.0.39

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

There are additional aliases and externals that I need to declare in the webpack configuration, so "please just use the stock config" isn't an option. Modifying the actual stock config underneath node_modules/@ionic/app-scripts/config/webpack.config.js isn't scalable, as it breaks both automated builds and builds from fresh repo clones.

@danbucholtz danbucholtz self-assigned this Nov 1, 2016
@alan-agius4
Copy link
Contributor

alan-agius4 commented Nov 1, 2016

Same issue here I am having some issues with webpack

image

Node Version: v6.9.0
NPM Version: 3.10.8
Windows 10

@alan-agius4
Copy link
Contributor

alan-agius4 commented Nov 1, 2016

#282

@msegers
Copy link

msegers commented Nov 8, 2016

I actually want my own webpack.config.js to be required. But it doesn't seem to work with these scripts. I Inject some SASS variables to have custom primary/accent colours and other config.

I really need this to work to be able to upgrade.

I'll look at source but for now it's breaking erryting!

@MikeLallemont
Copy link

MikeLallemont commented Nov 9, 2016

I have a custom webpack config that has an alias defined in the resolve section:

  resolve: {
    extensions: ['.js', '.ts', '.json'],
    alias: { 'adal': 'adal-angular' }        
  },

The problem is it fails to find the resolve before 'webpack started' message in the console. It errors out when transpiling. This only happens on a Windows machine and not on my Mac.

Any ideas? Here is the output:

ionic-app-scripts build

[08:36:14]  ionic-app-scripts 0.0.39
[08:36:14]  build dev started ...
[08:36:14]  clean started ...
[08:36:14]  clean finished in 7 ms
[08:36:14]  copy started ...
[08:36:14]  transpile started ...
[08:36:15]  lint started ...
[08:36:17]  lint finished in 2.09 s
[08:36:18]  typescript: C:/POCWork/ClientApp/node_modules/ng2-adal/services/adal.service.d.ts, line: 14
            Cannot find namespace 'adal'.

L13:  logOut(): void;
L14:  handleWindowCallback(): void;
L15:  getCachedToken(resource: string): string;

Thanks!

@MikeLallemont
Copy link

Oh I did upgrade to the 0.0.41 release of build scripts. Still fails.

@rapropos
Copy link
Author

rapropos commented Nov 9, 2016

The process described in the original report still hangs under 0.0.42.

@danbucholtz
Copy link
Contributor

@rapropos,

This should be fixed now. It hung because we had the same argument for -w for watch and webpack.

Thanks,
Dan

@rapropos
Copy link
Author

Confirmed fixed in 0.0.43

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

No branches or pull requests

6 participants