Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.