-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom.webpack.config.js
53 lines (48 loc) · 1.64 KB
/
custom.webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
var webpack = require('webpack');
var ionicWebpackFactory = require(process.env.IONIC_WEBPACK_FACTORY);
var ModuleConcatPlugin = require('webpack/lib/optimize/ModuleConcatenationPlugin');
var PurifyPlugin = require('@angular-devkit/build-optimizer').PurifyPlugin;
var useDefaultConfig = require('@ionic/app-scripts/config/webpack.config.js');
useDefaultConfig.dev.plugins = [
ionicWebpackFactory.getIonicEnvironmentPlugin(),
ionicWebpackFactory.getCommonChunksPlugin(),
new webpack.NormalModuleReplacementPlugin(/typeorm$/, function (result) {
result.request = result.request.replace(/typeorm/, "typeorm/browser");
}),
new webpack.ProvidePlugin({
'window.SQL': 'sql.js/js/sql.js'
})
]
useDefaultConfig.prod.plugins = [
ionicWebpackFactory.getIonicEnvironmentPlugin(),
ionicWebpackFactory.getCommonChunksPlugin(),
new ModuleConcatPlugin(),
new PurifyPlugin(),
new webpack.NormalModuleReplacementPlugin(/typeorm$/, function (result) {
result.request = result.request.replace(/typeorm/, "typeorm/browser");
})
]
module.exports = function () {
return useDefaultConfig;
};*/
const webpack = require('webpack');
console.log('The custom config is used');
module.exports = {
plugins: [
new webpack.ProvidePlugin({
'window.SQL': 'sql.js/js/sql.js'
}),
new webpack.NormalModuleReplacementPlugin(/typeorm$/, function (result) {
result.request = result.request.replace(/typeorm/, "typeorm/browser");
})
],
node: {
fs: 'empty',
net: 'empty',
tls: 'empty'
},
optimization: {
minimize: false
}
};