memories/webpack.js

35 lines
900 B
JavaScript
Raw Normal View History

2022-08-14 20:54:18 +00:00
const webpackConfig = require('@nextcloud/webpack-vue-config')
2022-10-17 02:52:44 +00:00
const WorkboxPlugin = require('workbox-webpack-plugin')
2022-09-13 01:33:24 +00:00
const path = require('path')
2022-10-17 02:52:44 +00:00
const buildMode = process.env.NODE_ENV
const isDev = buildMode === 'development'
2022-09-13 01:33:24 +00:00
webpackConfig.module.rules.push({
test: /\.ts?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/\.vue$/],
},
});
webpackConfig.resolve.extensions.push('.ts');
webpackConfig.resolve.alias = {
'vue$': 'vue/dist/vue.esm.js',
}
webpackConfig.entry.main = path.resolve(path.join('src', 'main'));
2022-08-14 20:54:18 +00:00
2022-10-15 19:21:53 +00:00
webpackConfig.watchOptions = {
ignored: /node_modules/,
aggregateTimeout: 300,
};
2022-12-07 20:25:19 +00:00
webpackConfig.plugins.push(
new WorkboxPlugin.InjectManifest({
swSrc: path.resolve(path.join('src', 'service-worker.js')),
swDest: 'memories-service-worker.js',
})
);
2022-10-17 02:52:44 +00:00
2022-08-14 20:54:18 +00:00
module.exports = webpackConfig