search

Home  >  Q&A  >  body text

javascript - webpack配置问题编译报错Output filename not configured.

var webpack = require('webpack');
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');
module.export={
  entry:{
    page:'./pages/static/script/healthInfo.js'
  },
  output:{
    path: './build/js',
    filename: '[name].js'
  },
  module:{
    loaders:[
      {test: /\.css$/, loader: 'style!css'},
      {test: /\.js$/, loader: 'jsx-loader'},
      {test: /\.less$/,loader: "style!css!less"},
      {test: /.(png|jpg)$/, loader: 'url-loader?limit=8192'}
    ]
  },

  resolve: {
    root: 'C:/Users/wonders/Desktop/webapp', //绝对路径
    extensions: ['', '.js', '.css'],
    alias: {
      'avalon': './pages/frame/avalon/avalon.mobile.shim.min',
      'Swiper': './pages/frame/Swiper/dist/js/swiper.min',
      'tips': './pages/static/script/models/tips',
      'fastclick': './pages/frame/fastclick/lib/fastclick',
      'jquery': './pages/frame/jquery/dist/jquery.min',
      'httpAjax': './pages/static/script/models/httpAjaxBack',
      'swiperAjax': './pages/static/script/models/swiperAjax'
  },
  },
  plugins: [commonsPlugin]
}
PHPzPHPz2902 days ago322

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-04-10 17:05:33

    module.export=>module.exports

    reply
    0
  • 迷茫

    迷茫2017-04-10 17:05:33

    确保entry是一个数组

    reply
    0
  • 迷茫

    迷茫2017-04-10 17:05:33

    entry写成了对象类型咯,应该是数组或字符串

    reply
    0
  • PHPz

    PHPz2017-04-10 17:05:33

    module.export=>module.exports

    reply
    0
  • Cancelreply