Skip to content

Instantly share code, notes, and snippets.

@aaronfrost
Created July 2, 2019 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronfrost/a8c86cb2653d62588cd629c392a4e8dc to your computer and use it in GitHub Desktop.
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
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