-
Notifications
You must be signed in to change notification settings - Fork 56
/
webpack.config.js
38 lines (32 loc) · 1.4 KB
/
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
/*
* The webpack config exports an object that has a valid webpack configuration
* For each environment name. By default, there are two Ionic environments:
* "dev" and "prod". As such, the webpack.config.js exports a dictionary object
* with "keys" for "dev" and "prod", where the value is a valid webpack configuration
* For details on configuring webpack, see their documentation here
* https://webpack.js.org/configuration/
*/
var webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
var useDefaultConfig = require('@ionic/app-scripts/config/webpack.config.js');
useDefaultConfig.dev.plugins.push(
new webpack.NormalModuleReplacementPlugin(/typeorm$/, function (result) {
result.request = result.request.replace(/typeorm/, "typeorm/browser");
}),
new webpack.ProvidePlugin({
'window.SQL': 'sql.js/dist/sql-wasm-debug.js'
}),
new CopyPlugin([ { from: 'node_modules/sql.js/dist/sql-wasm-debug.wasm', to: "../sql-wasm-debug.wasm" } ]),
);
useDefaultConfig.dev.plugins.push(
new webpack.NormalModuleReplacementPlugin(/typeorm$/, function (result) {
result.request = result.request.replace(/typeorm/, "typeorm/browser");
}),
new webpack.ProvidePlugin({
'window.SQL': 'sql.js/dist/sql-wasm.js'
}),
new CopyPlugin([ { from: 'node_modules/sql.js/dist/sql-wasm.wasm', to: "../sql-wasm.wasm" } ]),
);
module.exports = function () {
return useDefaultConfig;
};