-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack-react.config.js
More file actions
27 lines (26 loc) · 960 Bytes
/
webpack-react.config.js
File metadata and controls
27 lines (26 loc) · 960 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
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
mode: 'development',
entry: './client/scripts/app-react.js',
output: {
path: path.resolve(__dirname, 'dist/react'),
filename: 'bundle.js'
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader' },
{ test: require.resolve('jquery'), use: [{ loader: 'expose-loader', options: '$' }] },
{ test: require.resolve('jquery'), use: [{ loader: 'expose-loader', options: 'jQuery' }] },
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/, use: [{ loader: 'file-loader', options: { name: '[name].[ext]', outputPath: 'fonts/' }}]}
]
},
plugins: [
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
title: 'Minesweeper - React Edition'
})
]
}