Created
July 2, 2019 21:49
-
-
Save aaronfrost/a8c86cb2653d62588cd629c392a4e8dc to your computer and use it in GitHub Desktop.
This is a webpack.partial.js for an Angular CLI project that needs to use ngAnnotate and angular template loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
module.exports = { | |
module: { | |
rules: [ | |
{ | |
test: /\.ts$/, | |
exclude: /node_modules|src/, | |
use: [ | |
{ | |
loader: "ng-annotate-loader", | |
options: { | |
ngAnnotate: "ng-annotate-patched", | |
es6: true, | |
dynamicImport: true, | |
explicitOnly: false | |
} | |
} | |
], | |
enforce: "post" | |
}, | |
{ | |
test: /\.ts$/, | |
exclude: /node_modules|src/, | |
use: [ | |
{ loader: "angular2-template-loader" } | |
], | |
enforce: "pre" | |
} | |
] | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment