1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 13:53:34 +00:00

convert to ngtools/webpack for aot compilation

This commit is contained in:
Kyle Spearrin
2018-04-06 12:25:22 -04:00
parent 86226990ee
commit e27b2a7a53
28 changed files with 185 additions and 69 deletions

View File

@@ -4,6 +4,7 @@ const merge = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const GoogleFontsPlugin = require("google-fonts-webpack-plugin");
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
const isVendorModule = (module) => {
if (!module.context) {
@@ -30,9 +31,8 @@ const common = {
loader: 'tslint-loader'
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules\/(?!(@bitwarden)\/).*/
test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
loader: '@ngtools/webpack'
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
@@ -118,6 +118,11 @@ const renderer = {
path: 'fonts/',
filename: 'css/fonts.css'
}),
new AngularCompilerPlugin({
tsConfigPath: 'tsconfig.json',
entryModule: 'src/app/app.module#AppModule',
sourceMap: true
}),
// ref: https://github.com/angular/angular/issues/20357
new webpack.ContextReplacementPlugin(
/\@angular(\\|\/)core(\\|\/)esm5/,