A
A
Alesck2016-09-12 03:25:09
Google Chrome
Alesck, 2016-09-12 03:25:09

How to set up Webpack DevTools workspaces?

Recently started development with Webpack.
Previously compilation was via ruby ​​(console) and via Chrome Canary dev tools, scss/css file and sourcemap files were saved and updated locally.
Chrome dev tools screenshot:
prntscr.com/cgxr6z
Question:
We need a detailed algorithm of actions.
How to make dev tools Canary show changes in scss/js files immediately instead of after full page reload?
Thanks
webpack config:

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

var plugins = [];

var production = false;

if (production) {
  plugins.push(
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  );
}

plugins.push(
  new ExtractTextPlugin(
    path.join(
      '..', 'css', 'theme.css'
    )
  )
);

module.exports = {
  entry: [
    './js/theme.js'
  ],
  output: {
    path: '../assets/js',
    filename: 'theme.js'
  },
  module: {
    loaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loaders: ['babel-loader']
    }, {
      test: /\.scss$/,
      loader: ExtractTextPlugin.extract(
        "style",
        "css?sourceMap!postcss!sass?sourceMap"
      )
    }, {
      test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/,
      loader: 'file-loader?name=../css/[hash].[ext]'
    }, {
      test: /\.css$/,
      loader: "style-loader!css-loader!postcss-loader"
    }]
  },
  postcss: function() {
    return [require('postcss-flexibility')];
  },
  externals: {
    prestashop: 'prestashop'
  },
  debug: true,
  devtool: 'inline-source-map',
  plugins: plugins,
  resolve: {
    extensions: ['', '.js', '.scss']
  }
};

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question