亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

模塊被標記上 [not cacheable],而且多打了很多未知模塊

為什么有的模塊被標記上 [not cacheable],而且多打了很多模塊 ,跟老師做的不一樣,現在做到處理完less

http://img1.sycdn.imooc.com//5902a60000016b0a14801066.jpg

var?htmlWebpackPlugin?=?require('html-webpack-plugin');
var?path?=?require('path');

module.exports?=?{
????context:?__dirname,
????entry:?'./src/app.js',
????output:?{
????????path:?'./dist',
????????filename:?'js/[name].bundle.js'
????},
????module:?{
????????loaders:?[
????????????{
????????????????test:?/\.js$/,
????????????????loader:?'babel',
????????????????include:?path.resolve(__dirname,?'src'),????????????????
????????????????exclude:?path.resolve(__dirname,?'node_modules'),
????????????????query:?{
????????????????????presets:?['latest']
????????????????}
????????????},
????????????{
????????????????test:?/\.css$/,
????????????????loader:?'style!css?importLoaders=1!postcss'
????????????},
????????????{
????????????????test:?/\.less$/,
????????????????loader:?'style!css!postcss!less'
????????????}
????????]
????},
????postcss:?[
????????require('autoprefixer')({
????????????browsers:?['last?5?versions']
????????})
????],
????plugins:?[
????????new?htmlWebpackPlugin({
????????????filename:?'index.html',
????????????template:?'index.html',
????????????inject:?'body'
????????})
????]
}


正在回答

2 回答

但是不清楚為什么會把lodash打包進去

http://img1.sycdn.imooc.com//5902ac29000129a314640518.jpg

0 回復 有任何疑惑可以回復我~

自問自答:發現好像是 include 和 exclude 的路徑寫的有問題

exclude:path.resolve(__dirname,'/node_modules/'),
include:path.resolve(__dirname,'/src/'),

之前的 node_modules 和 src 不帶 / /

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
webpack深入與實戰
  • 參與學習       86557    人
  • 解答問題       750    個

webpack實戰教程,用真實項目帶你探索 webpack 強大的功能

進入課程

模塊被標記上 [not cacheable],而且多打了很多未知模塊

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號