1 Star 0 Fork 0

默一/fenduoduo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.dev.js 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
ZhangZisu 提交于 2020-03-21 19:04 . Rebuild
const path = require('path')
const monkey = require('./monkey.dev.config')
const fs = require('fs')
const webpack = require('webpack')
const moment = require('moment')
const colors = require('colors')
const common = require('./webpack.common')
const pkg = require('./package.json')
if (!fs.existsSync('build')) fs.mkdirSync('build')
fs.writeFileSync('./build/header.js', monkey.buildedHeader())
console.log(
`[${colors.grey(`${moment().format('HH:mm:ss')}`)}][${colors.grey(
'Webpack'
)}] ${colors.green(
'Copy the content of build/header.js to your TamperMonkey plugin'
)}`
)
module.exports = {
entry: monkey.config.entry,
output: {
path: path.resolve(__dirname, 'build'),
filename: `${pkg.name}.js`
},
watch: true,
mode: 'none',
module: {
rules: [
{
test: /\.css$/,
use: [{ loader: 'css-loader' }, { loader: 'postcss-loader' }]
},
{
test: /\.(png|jpg|gif)$/,
use: ['url-loader']
}
]
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1
}),
new webpack.DefinePlugin(common.generateDefinition(true))
]
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/nekomoyi/fenduoduo.git
[email protected]:nekomoyi/fenduoduo.git
nekomoyi
fenduoduo
fenduoduo
master

搜索帮助