代码拉取完成,页面将自动刷新
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))
]
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。