1 Star 0 Fork 2

lee5353/react-design-editor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.dev.js 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
sgoh 提交于 2019-03-05 10:18 . #89 updated docs
const webpack = require('webpack');
const merge = require('webpack-merge');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseConfig = require('./webpack.common.js');
const devPort = 8080;
const host = 'localhost';
module.exports = merge(baseConfig, {
mode: 'development',
devtool: 'inline-source-map',
entry: {
bundle: [
'@babel/polyfill',
'react-hot-loader/patch',
`webpack-dev-server/client?http://${host}:${devPort}`,
'webpack/hot/only-dev-server',
path.resolve(__dirname, 'src/index.js'),
],
},
output: {
path: path.resolve(__dirname, 'public'),
publicPath: '/',
filename: '[name].[hash:16].js',
chunkFilename: '[id].[hash:16].js',
},
devServer: {
inline: true,
port: devPort,
contentBase: path.resolve(__dirname, 'public'),
hot: true,
publicPath: '/',
historyApiFallback: true,
host,
proxy: {
'/api': {
target: 'http://localhost',
},
'/api/ws': {
target: 'ws://localhost',
ws: true,
},
},
headers: {
'X-Frame-Options': 'sameorigin', // used iframe
},
},
plugins: [
new webpack.HotModuleReplacementPlugin(), // HMR을 사용하기 위한 플러그인
new HtmlWebpackPlugin({
filename: 'index.html',
title: 'React Design Editor',
}),
],
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lee5353/react-design-editor.git
git@gitee.com:lee5353/react-design-editor.git
lee5353
react-design-editor
react-design-editor
master

搜索帮助