UNPKG

1.59 kBJavaScriptView Raw
1/**
2 * Adapted from angular2-webpack-starter
3 */
4
5const helpers = require('./config/helpers'),
6 webpack = require('webpack');
7
8/**
9 * Webpack Plugins
10 */
11const ProvidePlugin = require('webpack/lib/ProvidePlugin');
12const DefinePlugin = require('webpack/lib/DefinePlugin');
13const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
14
15module.exports = {
16 resolve: {
17 extensions: ['.ts', '.js']
18 },
19
20 entry: helpers.root('index.ts'),
21
22 output: {
23 path: helpers.root('bundles'),
24 publicPath: '/',
25 filename: 'index.umd.js',
26 libraryTarget: 'umd',
27 library: 'ng2-slim-loading-bar'
28 },
29
30 // require those dependencies but don't bundle them
31 externals: [/^\@angular\//, /^rxjs\//],
32
33 module: {
34 rules: [{
35 enforce: 'pre',
36 test: /\.ts$/,
37 loader: 'tslint-loader',
38 exclude: [helpers.root('node_modules')]
39 }, {
40 test: /\.ts$/,
41 loader: 'awesome-typescript-loader?declaration=false',
42 exclude: [/\.e2e\.ts$/]
43 }]
44 },
45
46 plugins: [
47 // fix the warning in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
48 new webpack.ContextReplacementPlugin(
49 /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
50 helpers.root('./src')
51 ),
52
53 new webpack.LoaderOptionsPlugin({
54 options: {
55 tslintLoader: {
56 emitErrors: false,
57 failOnHint: false
58 }
59 }
60 })
61 ]
62};