Commit c173b9a5 by hanjixin

change

parent 033d3689
......@@ -39,6 +39,7 @@
"chai": "^4.1.2",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"html-webpack-plugin": "^4.0.0-beta.5",
"lint-staged": "^8.1.5",
"node-sass": "^4.9.0",
"sass-loader": "^7.1.0",
......
const HtmlWebpackPlugin = require('html-webpack-plugin');
console.log(HtmlWebpackPlugin)
class InlineSourcePlugin {
constructor(match) {
this.reg = match
}
processTags(data, compilation) {
// 处理标签
console.log(data.headTags, data.bodyTags)
let headTags = [];
let bodyTags = [];
data.headTags.forEach(headTag => {
......@@ -17,6 +19,7 @@ class InlineSourcePlugin {
}
processTag(tag, compilation) {
let newTag, url;
console.log(tag, 'tag')
if(tag.tagName === 'link' && this.reg.test(tag.attributes.href) ) {
newTag = {
tagName: 'style',
......
......@@ -66,7 +66,7 @@ module.exports = {
// return args;
// });
// }
console.log(Object.values(config.module.rules)[1])
// console.log(Object.values(config.module.rules)[1])
},
configureWebpack: config => {
if (isProduction) {
......@@ -99,6 +99,10 @@ module.exports = {
config.plugins.push(new InlineSourcePlugin({
match: /\.(js|css)/
}))
// config.plugins.push(new HtmlWebpackPlugin({
// // filename: 'index.html'
// template: './public/index.html'
// }))
} else {
// 为开发环境修改配置...
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment