2

I'm moving from webpack to angular-cli and I need it to resolve minified js files. In webpack you'd add extensions: ['', '.ts', '.js', 'min.js', '.json'] to webpack.config. What is the equivalent in angular-cli?

2
  • Your question is directed at a solution... what are you trying to do? Is there a particular library you're trying to include? Commented Oct 6, 2016 at 4:07
  • I'm trying to include Wijmo 5. The documentation is based on systemjs and the webpack solution on the forums wijmo.com/topic/wijmo-5-and-webpack involves copying amd files to node_modules/wijmo. The amd files are the *min.js files in question. I found a solution of renaming the *.min.js files to *.js to get angular-cli's webpack to resolve them. Commented Oct 6, 2016 at 23:57

1 Answer 1

1

At the moment Angular CLI only supports loading .js and .ts files, as shown here.

You might have luck adding the path of the file to the scripts property of the angular-cli.json file (added in recent version before beta-16, not sure which one).

Apart from that, extending Webpack config is planned, but has no ETA, as the team hasn't worked on a suitable design for it yet.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I didn't try the scripts property but I found a solution of renaming the *.min.js files to *.js to get angular-cli's webpack to resolve them with minimal change to my projects structure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.