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 | devtool: 'inline-source-map',
|
17 |
|
18 | resolve: {
|
19 | extensions: ['.ts', '.js']
|
20 | },
|
21 |
|
22 | entry: helpers.root('ng2-translate.ts'),
|
23 |
|
24 | output: {
|
25 | path: helpers.root('bundles'),
|
26 | publicPath: '/',
|
27 | filename: 'ng2-translate.umd.js',
|
28 | libraryTarget: 'umd',
|
29 | library: 'ng2-translate'
|
30 | },
|
31 |
|
32 |
|
33 | externals: [/^\@angular\//, /^rxjs\
|
34 |
|
35 | module: {
|
36 | rules: [{
|
37 | enforce: 'pre',
|
38 | test: /\.ts$/,
|
39 | loader: 'tslint-loader',
|
40 | exclude: [helpers.root('node_modules')]
|
41 | }, {
|
42 | test: /\.ts$/,
|
43 | loader: 'awesome-typescript-loader?declaration=false',
|
44 | exclude: [/\.e2e\.ts$/]
|
45 | }]
|
46 | },
|
47 |
|
48 | plugins: [
|
49 |
|
50 | new webpack.ContextReplacementPlugin(
|
51 | /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
|
52 | helpers.root('./src')
|
53 | ),
|
54 |
|
55 | new webpack.LoaderOptionsPlugin({
|
56 | options: {
|
57 | tslintLoader: {
|
58 | emitErrors: false,
|
59 | failOnHint: false
|
60 | }
|
61 | }
|
62 | })
|
63 | ]
|
64 | };
|