forked from wan2land/unchartedwaters2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
67 lines (65 loc) · 1.71 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader')
module.exports = {
mode: 'production',
entry: __dirname + '/src/entry.ts',
output: {
path: __dirname + '/dist',
filename: '[name]_[hash].js',
libraryTarget: 'umd',
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.vue$/,
loaders: 'vue-loader',
},
{
test: /\.(js|ts)$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
use: {
loader: 'url-loader',
},
},
{
test: /\.css$/,
use: [
// 'style-loader',
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader',
],
},
],
},
devtool: '#source-map',
plugins: [
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: __dirname + '/src/index.html',
}),
new MiniCssExtractPlugin({
filename: '[name]_[hash].css',
}),
new CopyWebpackPlugin({
patterns: [
{ from: __dirname + '/CNAME' },
{ from: __dirname + '/node_modules/js-dos/dist/wdosbox.js', to: 'static' },
{ from: __dirname + '/node_modules/js-dos/dist/wdosbox.wasm.js', to: 'static' },
{ from: 'game/water2.zip', to: 'static' },
{ from: 'game/mod_junghwa_v3.0.zip', to: 'static' },
{ from: 'game/mod_ernst_v1.11.zip', to: 'static' },
],
}),
],
}