restore Assets
This commit is contained in:
parent
79d92c01da
commit
109d5bf32c
1 changed files with 34 additions and 0 deletions
|
@ -5,6 +5,24 @@ const packageConfig = require('./package.json');
|
|||
const WorkboxPlugin = require('workbox-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
const Assets = [
|
||||
'alameda/alameda.js',
|
||||
'native-promise-only/npo.js',
|
||||
'libarchive.js/dist/worker-bundle.js',
|
||||
'libass-wasm/dist/js/subtitles-octopus-worker.js',
|
||||
'libass-wasm/dist/js/subtitles-octopus-worker.data',
|
||||
'libass-wasm/dist/js/subtitles-octopus-worker.wasm',
|
||||
'libass-wasm/dist/js/subtitles-octopus-worker-legacy.js',
|
||||
'libass-wasm/dist/js/subtitles-octopus-worker-legacy.data',
|
||||
'libass-wasm/dist/js/subtitles-octopus-worker-legacy.js.mem',
|
||||
'pdfjs-dist/build/pdf.worker.js'
|
||||
];
|
||||
|
||||
const LibarchiveWasm = [
|
||||
'libarchive.js/dist/wasm-gen/libarchive.js',
|
||||
'libarchive.js/dist/wasm-gen/libarchive.wasm'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, 'src'),
|
||||
target: 'web',
|
||||
|
@ -39,6 +57,22 @@ module.exports = {
|
|||
}
|
||||
]
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: Assets.map(asset => {
|
||||
return {
|
||||
from: path.resolve(__dirname, `./node_modules/${asset}`),
|
||||
to: path.resolve(__dirname, './dist/libraries')
|
||||
};
|
||||
})
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: LibarchiveWasm.map(asset => {
|
||||
return {
|
||||
from: path.resolve(__dirname, `./node_modules/${asset}`),
|
||||
to: path.resolve(__dirname, './dist/libraries/wasm-gen')
|
||||
};
|
||||
})
|
||||
}),
|
||||
new WorkboxPlugin.InjectManifest({
|
||||
swSrc: path.resolve(__dirname, 'src/serviceworker.js'),
|
||||
swDest: 'serviceworker.js'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue