[Enhancement Request] Angular compiler settings
See original GitHub issueHi Jeffrey,
In its current state, it’s not possible to run laravel mix for Angular in production mode without breaking the Angular. I do understand that Laravel is preferring Vue over Angular, but given the market share for Angular, I’d like to request to add ng-angular-annotations into the package as well.
I’ve tried to use the ng-angular-loader and add it to the config with webpackConfig but for some reason the loader doesn’t properly annotate.
The only solution that I found is to use the ng-annotate-webpack-plugin. Unfortunately, I have to use a custom webpack.config.js to add this package, as I couldn’t include the package via the merge command.
Here’s the current custom code that I’m adding:
let ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
module.exports = {
plugins: [
new ngAnnotatePlugin({
add: true
})
]
};
Sorry if I overlooked an easier solution. I’m still fairly new to webpack2 - and thank you for your time!
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top GitHub Comments
My solution to this was to use
babel-loader
with
babel-plugin-angularjs-annotate
uglifyjs-webpack-plugin
causesng-annotate-webpack-plugin
to break andng-annotate-loader
won’t work if you use arrow functions, but the babel way works great for me.ngAnnotate works fine for me like this: