3 Star 0 Fork 0

陈博/webpack-html-dev

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
陈博 提交于 2025-02-11 11:36 +08:00 . sd
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const CopyFilePlugin = require('copy-webpack-plugin')
const publicPath = '/'
module.exports = {
// entry: './src/index.js',
entry: './src/view3d.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'view3d.bundle.js',
publicPath: publicPath
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}, {
test: /\.scss$/,
use: ["style-loader", 'css-loader', 'sass-loader']
},
{
test: /\.(js|jsx)$/,
use: 'babel-loader'
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(), // 自动刷新。
// new ExtractTextPlugin("[name].css"),
// new HtmlWebpackPlugin({ template: './src/index.html' }),
new HtmlWebpackPlugin({ template: './src/threejs.html' }),
new CopyFilePlugin({
patterns: [
{
from: __dirname + '/src/assets',
to: __dirname + '/dist/assets'
}
]
})
],
devServer: {
contentBase: path.resolve(__dirname, 'dist'),
open: true,
hot: true,
port: 9001
},
mode: 'development'
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/facemap/webpack-html-dev.git
git@gitee.com:facemap/webpack-html-dev.git
facemap
webpack-html-dev
webpack-html-dev
master

搜索帮助