1 |
|
2 |
|
3 |
|
4 |
|
5 | const helpers = require('./config/helpers'),
|
6 | webpack = require('webpack');
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | const ProvidePlugin = require('webpack/lib/ProvidePlugin');
|
12 | const DefinePlugin = require('webpack/lib/DefinePlugin');
|
13 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
|
14 |
|
15 | module.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 |
|
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 |
|
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 | };
|