2019-09-30 16:58:05 -07:00
|
|
|
const path = require("path");
|
2019-11-10 09:45:01 -07:00
|
|
|
|
|
|
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
2019-09-30 16:58:05 -07:00
|
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
2019-11-10 09:45:01 -07:00
|
|
|
|
2019-11-06 17:02:32 -07:00
|
|
|
const Assets = [
|
|
|
|
"alameda/alameda.js",
|
2019-11-08 06:54:12 -07:00
|
|
|
"requirejs/require.js",
|
|
|
|
"libass-wasm/dist/subtitles-octopus-worker.js",
|
|
|
|
"libass-wasm/dist/subtitles-octopus-worker.data",
|
|
|
|
"libass-wasm/dist/subtitles-octopus-worker.wasm"
|
2019-11-06 17:02:32 -07:00
|
|
|
];
|
2019-04-28 03:38:30 -07:00
|
|
|
|
|
|
|
module.exports = {
|
2019-09-30 16:58:05 -07:00
|
|
|
context: path.resolve(__dirname, "src"),
|
|
|
|
entry: "./bundle.js",
|
2019-04-28 03:38:30 -07:00
|
|
|
resolve: {
|
|
|
|
modules: [
|
2019-09-30 16:58:05 -07:00
|
|
|
path.resolve(__dirname, "node_modules")
|
2019-04-28 03:38:30 -07:00
|
|
|
]
|
2019-05-24 21:28:06 -07:00
|
|
|
},
|
2019-09-30 16:58:05 -07:00
|
|
|
plugins: [
|
2019-10-27 06:55:18 -07:00
|
|
|
new CleanWebpackPlugin(),
|
2019-09-30 16:58:05 -07:00
|
|
|
new CopyPlugin([{
|
|
|
|
from: "**/*",
|
|
|
|
to: "."
|
2019-10-27 06:55:18 -07:00
|
|
|
}]),
|
|
|
|
new CopyPlugin(
|
|
|
|
Assets.map(asset => {
|
|
|
|
return {
|
|
|
|
from: path.resolve(__dirname, `./node_modules/${asset}`),
|
2019-11-26 13:03:03 -07:00
|
|
|
to: path.resolve(__dirname, "./dist/libraries")
|
2019-10-27 06:55:18 -07:00
|
|
|
};
|
|
|
|
})
|
|
|
|
)
|
2019-09-30 16:58:05 -07:00
|
|
|
]
|
2019-05-22 12:18:17 -07:00
|
|
|
};
|