Failed to load the script unexpectedly回避

sw.jsとlib.tsを分離してみた
This commit is contained in:
tamaina
2021-11-30 03:12:32 +09:00
parent 7e5ab7af1b
commit 47d77d14fd
6 changed files with 62 additions and 28 deletions

View File

@@ -23,7 +23,7 @@ const meta = require('../../package.json');
module.exports = {
target: 'webworker',
entry: {
sw: './src/sw.ts'
['sw-lib']: './src/lib.ts'
},
module: {
rules: [{
@@ -35,7 +35,6 @@ module.exports = {
happyPackMode: true,
transpileOnly: true,
configFile: __dirname + '/tsconfig.json',
appendTsSuffixTo: [/\.vue$/]
}
}]
}]
@@ -56,7 +55,7 @@ module.exports = {
],
output: {
path: __dirname + '/../../built/_sw_dist_',
filename: `[name].${meta.version}.js`,
filename: `[name].js`,
publicPath: `/`,
pathinfo: false,
},
@@ -71,9 +70,6 @@ module.exports = {
resolveLoader: {
modules: ['node_modules']
},
experiments: {
topLevelAwait: true
},
devtool: false, //'source-map',
mode: isProduction ? 'production' : 'development'
};