您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

webpack.config.js 733B

123456789101112131415161718192021222324252627282930313233343536373839
  1. var path = require("path");
  2. var ExtractTextPlugin = require("extract-text-webpack-plugin");
  3. var webpack = require("webpack");
  4. module.exports = {
  5. entry: {
  6. app: './js/main.js'
  7. },
  8. module: {
  9. rules: [
  10. {
  11. test: /\.css$/,
  12. use: ExtractTextPlugin.extract({
  13. fallback: "style-loader",
  14. use: 'css-loader?importLoaders=1!postcss-loader'
  15. })
  16. }
  17. ]
  18. },
  19. output: {
  20. path: path.join(__dirname, "./../static/dist"),
  21. filename: '[name].bundle.js',
  22. },
  23. resolve: {
  24. modules: [path.resolve(__dirname, 'src'), 'node_modules'],
  25. },
  26. plugins: [
  27. new ExtractTextPlugin("main.css"),
  28. new webpack.ProvidePlugin({
  29. $: "jquery",
  30. jQuery: "jquery"
  31. })
  32. ],
  33. watchOptions: {
  34. watch: true
  35. }
  36. }