Skip to content

Commit

Permalink
restore Assets
Browse files Browse the repository at this point in the history
  • Loading branch information
hawken93 committed Nov 21, 2020
1 parent 79d92c0 commit 109d5bf
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 109d5bf

Please sign in to comment.