2020-01-01 08:11:57 +00:00
|
|
|
const path = require('path');
|
2019-12-12 17:37:43 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
pages: {
|
|
|
|
index: {
|
|
|
|
entry: 'src/main.js',
|
|
|
|
filename: 'index.html'
|
|
|
|
},
|
|
|
|
print: {
|
|
|
|
entry: 'src/print.js',
|
|
|
|
filename: 'print.html'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
runtimeCompiler: true,
|
|
|
|
lintOnSave: process.env.NODE_ENV !== 'production',
|
|
|
|
configureWebpack(config) {
|
|
|
|
Object.assign(config.resolve.alias, {
|
|
|
|
deepmerge$: 'deepmerge/dist/umd.js',
|
2020-01-01 08:11:57 +00:00
|
|
|
'frappe-charts$': 'frappe-charts/dist/frappe-charts.esm.js',
|
|
|
|
'~': path.resolve('.')
|
2019-12-12 17:37:43 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
config.plugins.push(
|
|
|
|
// https://github.com/knex/knex/issues/1446#issuecomment-537715431
|
|
|
|
new webpack.ContextReplacementPlugin(
|
2019-12-16 11:27:28 +00:00
|
|
|
/knex[/\\]lib[/\\]dialects/,
|
|
|
|
/sqlite3[/\\]index.js/
|
2019-12-12 17:37:43 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
config.devtool = 'source-map';
|
|
|
|
},
|
|
|
|
transpileDependencies: ['frappejs']
|
|
|
|
};
|