Webpack extract-text-plugin不生成css文件

时间:2016-02-18 07:42:14

标签: javascript webpack

我似乎无法获取提取文本来生成css文件。根据终端输出,一切似乎都在起作用......

Hash: 6f3fbe6dc6579eaaa20d
Version: webpack 1.12.13
Time: 13386ms
                               Asset     Size  Chunks             Chunk Names
1063657bf1df8e12d7a0edb158e771f1.png  4.17 kB          [emitted]  
77e517253e6e8ac4520fc2843ee8e71d.png  1.29 kB          [emitted]  
e00fc18b73822b9e79556f8a0130088b.png  1.37 kB          [emitted]  
                           bundle.js  1.08 MB       0  [emitted]  main
                           style.css  35.2 kB       0  [emitted]  main
chunk    {0} bundle.js, style.css (main) 916 kB [rendered]
    [0] multi main 64 bytes {0} [built]
    [1] (webpack)-dev-server/client?http://localhost:8080 2.67 kB {0} [built]
    [2] (webpack)/~/node-libs-browser/~/url/url.js 22.3 kB {0} [built]
    [3] (webpack)/~/node-libs-browser/~/url/~/punycode/punycode.js 14.6 kB {0} [built]
    [4] (webpack)/buildin/module.js 251 bytes {0} [built]


...


  [260] ./app/js/components/LocationForm.js 7.12 kB {0} [built]
  [261] ./app/styles/manifest.scss 41 bytes {0} [built]
Child extract-text-webpack-plugin:
    chunk    {0} extract-text-webpack-plugin-output-filename 38.9 kB [rendered]
        [0] ./~/css-loader!./~/sass-loader?indentedSyntax=true&sourceMap=true!./app/styles/manifest.scss 37.1 kB {0} [built]
        [1] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
        [2] ./app/assets/images/confetti.png 82 bytes {0} [built]
        [3] ./app/assets/icons/icon-email.png 82 bytes {0} [built]
        [4] ./app/assets/icons/icon-zipcode.png 82 bytes {0} [built]
webpack: bundle is now VALID.

这是我的webpack.config:

var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
  devtool: 'eval',
  entry: [
    './index'
  ],
  output: {
    path: path.join(__dirname, 'build'),
    filename: "[name].js",
    chunkFilename: "[id].js",
    publicPath: '/build/'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        loaders: ['babel'],
        include: path.join(__dirname, './'),
        exclude: [
          path.join(__dirname, './node_modules/')
        ]
      },
      {
        test: /\.scss$/,
        exclude: [
          path.join(__dirname, './node_modules/')
        ],
        loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')
      },
      { test: /\.png$/,    loader: "file-loader" },
      { test: /\.jpg$/,    loader: "file-loader" },
      { test: /\.gif$/,    loader: "file-loader" }
    ]
  },
  inline: true,
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new ExtractTextPlugin('[name].css')
  ]
};

非常困惑为什么这不起作用所以任何帮助都表示赞赏,谢谢。

1 个答案:

答案 0 :(得分:1)

似乎正在生成,尝试查看http://domain:port/webpack-dev-server是否存在

extract-text-webpack-plugin:
chunk    {0} extract-text-webpack-plugin-output-filename 38.9 kB [rendered]