Skip to content

Commit

Permalink
chore: update example with typeorm 0.2.28 / typescript 3.3.3333 / sql…
Browse files Browse the repository at this point in the history
….js 1.3.0 (#38)
  • Loading branch information
imnotjames authored Oct 16, 2020
1 parent 7bd88df commit a5187e4
Showing 3 changed files with 8,173 additions and 21 deletions.
29 changes: 13 additions & 16 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -8,33 +8,30 @@
*/

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;
const CopyPlugin = require('copy-webpack-plugin');

var useDefaultConfig = require('@ionic/app-scripts/config/webpack.config.js');

useDefaultConfig.dev.plugins = [
ionicWebpackFactory.getIonicEnvironmentPlugin(),
ionicWebpackFactory.getCommonChunksPlugin(),
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/js/sql.js'
})
]
'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.prod.plugins = [
ionicWebpackFactory.getIonicEnvironmentPlugin(),
ionicWebpackFactory.getCommonChunksPlugin(),
new ModuleConcatPlugin(),
new PurifyPlugin(),
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;
Loading

0 comments on commit a5187e4

Please sign in to comment.