forked from p15670423/monkey
74 lines
1.3 KiB
JavaScript
74 lines
1.3 KiB
JavaScript
const path = require('path');
|
|
const HtmlWebPackPlugin = require("html-webpack-plugin");
|
|
|
|
module.exports = {
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader"
|
|
}
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
'style-loader',
|
|
'css-loader'
|
|
]
|
|
},
|
|
{
|
|
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
|
use: {
|
|
loader: 'file-loader'
|
|
}
|
|
},
|
|
{
|
|
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
|
use: {
|
|
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
|
|
}
|
|
},
|
|
{
|
|
test: /\.(png|jpg|gif)$/,
|
|
use: {
|
|
loader: 'url-loader?limit=8192'
|
|
}
|
|
},
|
|
{
|
|
test: /\.html$/,
|
|
use: [
|
|
{
|
|
loader: "html-loader"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new HtmlWebPackPlugin({
|
|
template: "./src/index.html",
|
|
filename: "./index.html"
|
|
})
|
|
],
|
|
resolve: {
|
|
extensions: ['.js', '.jsx', '.css'],
|
|
modules: [
|
|
'node_modules',
|
|
path.resolve(__dirname, 'src/')
|
|
]
|
|
},
|
|
output: {
|
|
publicPath: '/'
|
|
},
|
|
devServer: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'https://localhost:5000',
|
|
secure: false
|
|
}
|
|
}
|
|
}
|
|
};
|