Skip to content

Instantly share code, notes, and snippets.

@finethanks
Created June 8, 2017 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save finethanks/67a9c21ab6d274e07c8e82604943dcf9 to your computer and use it in GitHub Desktop.
Save finethanks/67a9c21ab6d274e07c8e82604943dcf9 to your computer and use it in GitHub Desktop.
extract plugin не резовит свою папку в node_modules
const path = require('path');
const NODE_ENV = process.env.NODE_ENV || 'development';
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractSass = new ExtractTextPlugin("style.css");
const nodeModulesPath = path.resolve(__dirname, '', 'node_modules');
const assetsPath = path.resolve(__dirname, '', 'templates/src');
const buildPath = path.resolve(__dirname, '', 'templates/.default');
module.exports = {
entry: "./templates/src/app.js",
output: {
path: buildPath,
filename: "script.js",
},
module: {
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
use: ["babel-loader"]
},
{
rules: [{
test: /\.s?css$/,
use: extractSass.extract({
use: [
{
loader: "css-loader", // translates CSS into CommonJS
},
{
loader: "resolve-url-loader?sourceMap" // translates CSS into CommonJS
},
{
loader: "sass-loader?sourceMap", // compiles Sass to CSS
options: {
includePaths: []
}
}
],
fallback: 'style-loader'
})
}]
}
]
},
plugins: [
extractSass
],
watch: NODE_ENV === 'development'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment