网站有太多css文件怎么处理,css文件的 处理有问题

{

test: /.styl/,

use: [

MiniCssExtractPlugin.loader,

‘css-loader’,

{

loader: ‘postcss-loader’,

options: {

sourceMap: true

}

},

‘stylus-loader’

]

}

然后运行

npm run dev:server

server is listening on 0.0.0.0

./client/app.vue?vue&type=style&index=0&id=7752612a&lang=stylus&scoped=true& (./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref–5-2!./node_modules/stylus-loader!./node_modules/vue-loader/lib??vue-loader-options!./client/app.vue?vue&type=style&index=0&id=7752612a&lang=stylus&scoped=true&)

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):

TypeError: this[NS] is not a function

at childCompiler.runAsChild (/Users/achilles/yilong/todo/node_modules/mini-css-extract-plugin/dist/loader.js:148:15)

后来又修改为:

plugins: defaultPluins.concat([

new webpack.DefinePlugin({

“process.env.NODE_ENV”: JSON.stringify(JSON.stringify(process.env.NODE_ENV || ‘development’)),

“process.env.VUE_ENV”: ‘“server”’

}),

new VueServerPlugin(),

new MiniCssExtractPlugin({

// Options similar to the same options in webpackOptions.output

// both options are optional

filename: ‘[name].[hash].css’,

chunkFilename: ‘[id].[hash].css’

})

//new webpack.HotModuleReplacementPlugin()

// new webpack.NoEmitOnErrorsPlugin()

])

也还是没又样式。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值