-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (34 loc) · 952 Bytes
/
webpack.config.js
File metadata and controls
35 lines (34 loc) · 952 Bytes
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
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const project = require('./package');
const outputDirectory = 'dist';
module.exports = {
entry: path.join(__dirname, '/src/js/index.js'),
output: {
filename: 'build.js',
path: path.join(__dirname, outputDirectory)
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}]
}
,
plugins: [
new CleanWebpackPlugin([outputDirectory]),
new HtmlWebpackPlugin(
{
template: path.join(__dirname, '/src/index.html'),
title: 'MineSweeper',
version: project.version
}
)
]
};