Closed jesperlandberg closed 7 years ago
I'm trying to extract my css but get lots of errors. Using "extract-text-webpack-plugin": "2.0.0-beta.4" and "webpack": "2.1.0-beta.25".
This is my setup:
'use strict'; const webpack = require("webpack"); const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { context: __dirname + "/src", entry: { app: "./js/app.js", }, output: { path: __dirname + "/dist", publicPath: "/dist/", filename: "[name].bundle.js", }, devServer: { contentBase: __dirname + "/src", }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, use: [{ loader: "babel-loader", options: { presets: ["es2015"] } }], }, { test: /\.(sass|scss)$/, loader: ExtractTextPlugin.extract(["style-loader", "css-loader?importLoaders=1", "postcss-loader", "sass-loader"]) }, { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' } ], }, externals: { 'TweenLite': 'TweenLite' }, plugins: [ new webpack.LoaderOptionsPlugin({ options: { postcss: [ require ('postcss-cssnext'), ], }, }), new ExtractTextPlugin("app.bundle.css") ], };
I think you should remove style-loader from ExtractTextPlugin.extract()
style-loader
ExtractTextPlugin.extract()
ExtractTextPlugin.extract signature is a little different now. Please see the readme for a good example.
ExtractTextPlugin.extract
I'm trying to extract my css but get lots of errors. Using "extract-text-webpack-plugin": "2.0.0-beta.4" and "webpack": "2.1.0-beta.25".
This is my setup: