Доброго времени суток! Не удается мне сохранить CSS файл после загрузчиков.
Базовый конфигvar path = require("path")
var webpack = require('webpack')
module.exports = {
context: __dirname,
entry: {
app: './app/app.js',
style: './sass/main.scss',
vendors: ['react'],
},
output: {
path: path.resolve('../static/bundles/local/'),
filename: '[name]-[hash].js',
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({name: 'vendors', filename: 'vendors.js'}),
], // add all common plugins here
module: {
rules: []
},
resolve: {
modules: ['node_modules', 'bower_components'],
extensions: ['.js', '.jsx']
},
}
И главный конфиг
var webpack = require('webpack')
var BundleTracker = require('webpack-bundle-tracker')
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var autoprefixer = require("autoprefixer")
var config = require('./webpack.base.config.js')
var path = require('path')
config.devtool = "#eval-source-map"
config.entry.app = ['webpack-dev-server/client?http://localhost:3001', 'webpack/hot/only-dev-server', './app/app.js'];
config.output.publicPath = 'http://localhost:3001/assets/bundles/';
config.plugins = config.plugins.concat([
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new BundleTracker({ filename: '../static/bundles/webpack-stats.json' }),
new ExtractTextPlugin('../static/css/main.min.css', {
allChunks: true
})
])
config.devServer = {
publicPath: config.output.publicPath,
hot: true,
inline: true,
historyApiFallback: false,
stats: 'errors-only',
port: '3001',
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
}
}
config.module.rules.push(
{ test: /\.jsx?$/, exclude: /node_modules/, use: ['react-hot-loader', 'babel-loader'] },
{ test: /\.scss$/, use: ExtractTextPlugin.extract(['css-loader', 'sass-loader'])}
)
module.exports = config
Запускаю так:
"start:dev": "webpack-dev-server --config webpack.dev.config.js",
Задача проста: сохранить файл именно там, где я указал в ExtractTextPlugin, но почему-то не сохраняет