micro-editor
Version:
1. npm install
41 lines (40 loc) • 1.11 kB
JavaScript
const merge = require('webpack-merge');
const webpack = require('webpack');
const common = require('./webpack.common.js');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const tsImportPluginFactory = require('ts-import-plugin');
module.exports = merge(common, {
entry: './src/app.jsx',
output: {
filename: 'static/[name].[hash].js',
chunkFilename: 'static/[name].[chunkhash].js',
path: path.resolve(__dirname, 'dist'),
publicPath:"/"
},
mode: "development",
devtool: 'inline-source-map',
devServer: {
contentBase: './dist',
port:8001,
hot: true,
overlay: true,
compress: true,
historyApiFallback: true,
disableHostCheck: true,
inline: true
},
plugins: [
new HtmlWebpackPlugin({
title: 'editor',
template: './index.html',
filename: 'index.html'
}),
new webpack.HashedModuleIdsPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
}),
]
});