1 |
|
2 |
|
3 |
|
4 |
|
5 | const helpers = require('./config/helpers'),
|
6 | webpack = require('webpack'),
|
7 | CleanWebpackPlugin = require('clean-webpack-plugin');
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | const ProvidePlugin = require('webpack/lib/ProvidePlugin');
|
13 | const DefinePlugin = require('webpack/lib/DefinePlugin');
|
14 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
|
15 |
|
16 | module.exports = {
|
17 | devtool: 'inline-source-map',
|
18 |
|
19 | resolve: {
|
20 | extensions: ['.ts', '.js']
|
21 | },
|
22 |
|
23 | entry: helpers.root('index.ts'),
|
24 |
|
25 | output: {
|
26 | path: helpers.root('bundles'),
|
27 | publicPath: '/',
|
28 | filename: 'core.umd.js',
|
29 | library: 'ngx-translate-core',
|
30 | libraryTarget: 'umd'
|
31 | },
|
32 |
|
33 |
|
34 | externals: [/^\@angular\//, /^rxjs\
|
35 |
|
36 | module: {
|
37 | rules: [{
|
38 | enforce: 'pre',
|
39 | test: /\.ts$/,
|
40 | loader: 'tslint-loader',
|
41 | exclude: [helpers.root('node_modules')]
|
42 | }, {
|
43 | test: /\.ts$/,
|
44 | loader: 'awesome-typescript-loader',
|
45 | options: {
|
46 | declaration: false
|
47 | },
|
48 | exclude: [/\.spec\.ts$/]
|
49 | }]
|
50 | },
|
51 |
|
52 | plugins: [
|
53 |
|
54 | new webpack.ContextReplacementPlugin(
|
55 | /angular(\\|\/)core(\\|\/)@angular/,
|
56 | helpers.root('./src')
|
57 | ),
|
58 |
|
59 | new webpack.LoaderOptionsPlugin({
|
60 | options: {
|
61 | tslintLoader: {
|
62 | emitErrors: false,
|
63 | failOnHint: false
|
64 | }
|
65 | }
|
66 | }),
|
67 |
|
68 |
|
69 |
|
70 | new CleanWebpackPlugin(['bundles'], {
|
71 | root: helpers.root(),
|
72 | verbose: false,
|
73 | dry: false
|
74 | })
|
75 | ]
|
76 | };
|