This repository was archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 511
This repository was archived by the owner on May 29, 2019. It is now read-only.
Entry chunks for .css files also creating .js files #518
Copy link
Copy link
Closed
Description
My config file is working fine. But I've just noticed it's generating extraneous files based on the entry points. The entry for login generates the correct .css file from the .scss file but also creates a login.js file (it essentially has an empty function inside it). Is there a way to prevent this?
Currently using Webpack 2.6.0 and Extract Text Webpack Plugin 2.1.0
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, './.'),
entry: {
'main': [
'./js/main.js',
'./sass/main.scss',
],
'login': './sass/admin/login.scss',
},
output: {
path: path.resolve(__dirname, '../public'),
publicPath: '/public/',
filename: 'scripts/[name].js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: [/(node_modules|bower_components)/],
use: [
{
loader: 'buble-loader',
options: {
objectAssign: 'Object.assign'
},
}
],
},
{
test: /\.(sass|scss)$/,
use: ExtractTextPlugin.extract({
use: [
'css-loader',
'sass-loader'
]
})
},
]
},
resolve: {
modules: [
"node_modules"
],
},
plugins: [
new ExtractTextPlugin({
filename: 'styles/[name].css',
allChunks: true,
}),
]
}
Here's what the extraneous login.js file contains:
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};
return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};
n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};
return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/public/",n(n.s=5)}({5:function(e,n){}});
StanislavMayorov, bhvreddy, ArunMichaelDsouza, majman, Georgette and 31 more
Metadata
Metadata
Assignees
Labels
No labels