Using Babel loader with ngAnnotate plugin
See original GitHub issueHey there. Loving your project!
Small Issue I currently have:
I want to use Babel with ngAnnotate to annotate my old AngularJS files after they have been bundled by angular-cli/webpack. I want use an Angular hybrid app.
Since ‘ng eject’ isn’t working anymore I wanted to use this library to include babel into my build.
I managed to get my custom webpack config loaded, but it doesn’t seem to pickup the files and transpile them.
This is how my configs are looking like:
angular.json
"build": {
"builder": "angular-cli-builders:custom-webpack-browser",
"options": {
"customWebpackConfig": {
"path": "./webpack.config.js",
"replaceDuplicatePlugins": true,
"mergeStrategies": { "externals": "replace" }
}
webpack.config.js
module: {
rules: [{
test : /\.js$/,
exclude: /(node_modules|bower_components)/,
use : [{
loader : 'babel-loader',
options: {
presets: [ 'es2015' ],
plugins: [ require('babel-plugin-angularjs-annotate') ]
}
}]
}]
}
};
Do you have an idea what might be the problem here?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Using Babel loader with ngAnnotate plugin · Issue #12
I want to use Babel with ngAnnotate to annotate my old AngularJS files after they have been bundled by angular-cli/webpack.
Read more >babel-plugin-angularjs-annotate
This plugin currently supports matching and transforming all of the patterns currently recognized by ng-annotate (explicit and implicit), and ...
Read more >ng-annotate-loader v0.7.0
ng-annotate -loader Build Status. Webpack loader to annotate angular applications. Generates a sourcemaps as well. Installation.
Read more >How to use ng-annotate with hybrid app based on angular-cli
Installing babel and babel-plugin-angularjs-annotate; Executing babel, which takes the files from src , adds the annotations, and puts the ...
Read more >babel-loader
See the docs for more information. NOTE: You must run npm install -D @babel/plugin-transform-runtime to include this in your project and @babel ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If it’s not working you are welcome to create a reproduction repo and we’ll figure it out. I can reopen this issue or you can create a brand new one.
For the mean time, this is what my
webpack.partial.ts
file looks like: