reactjs


Webpack 2 extract text plugin entrypoints.length issues


I have an issue with upgrading to webpack 2 and the extract text plugin. I have the dev version (without this plugin) working and I cant see whats different. The error I get is
node_modules\webpack\lib\Chunk.js:62
return this.entrypoints.length > 0;
TypeError: Cannot read property 'length' of undefined
I have gulp running webpack 2 and this plugin for a single css file. This is the main part of my webpack config (happy to provide it all if needed):
...
modules: { rules :[ ... {
test: /\.scss/,
exclude: /node_modules/,
use: [
"style-loader?sourceMap",
{
loader: "css-loader",
options: {
minimize: true,
modules: true,
importLoaders: true,
localIdentName: "[path]___[name]__[local]___[hash:base64:5]",
},
},
{
loader: "postcss-loader",
options: { ...postCSSConfig },
},
{
loader: "sass-loader",
options: { includePaths: [path.join(process.cwd(), "src", "Styles", "Includes")] },
},
],
}, ]},
plugins: [
new ExtractTextPlugin({
filename: "[contenthash].css",
allChunks: true,
}), ...
Im using the following versions:
Webpack: 2.3.3
Extract text plugn: 2.0.1
Edit: Here is my entry point,
context: path.resolve(process.cwd(), "./src/"),
entry: [
"babel-polyfill",
"whatwg-fetch",
"Boot",
],
devtool: "eval",
resolve: {
modules: ["src", "node_modules"],
extensions: [".js", ".jsx"],
},
Any ideas would be great.
Thanks in advance.
According to docs, you also have to create proper rule for loading styles.
Please take a look at that, it's my rule. Please let me know if it helped you.
{
test: /\.(scss|css)$/,
exclude: /node_modules/
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader', 'sass-loader']
})
}
Anyway, yet I didn't manage to use ExtractTextPlugin with sourceMaps, so I can't give you solution to use this plugin with source maps.

Related Links

when use redux, can I call api in container component?
Avoid navigation in react.js on button click
React Native 0.43 upgrade: react#16.0.0-alpha.6 does not satisfy its siblings
Synchronous callback for require.ensure in Webpack 2
Test a create-react-app index.js file
Redirect after submit success redux-form
redux-promise: Uncaught TypeError: middleware is not a function
Have child of react component know the height of other child within the component
React Redux - Is there a way to wait until redux dispatch actions are finished via a promise?
Redux, store same value more than once
ImmutableJS Map, how to iterate over a map and return a modified result
How to get filtered object length
Updating Redux with Sqlite3 in an Electron application
Redux - how to call an action creator from inside another action creator?
Fetch API cannot load, cors
Reactjs datatable with tree grid support

Categories

HOME
pact
optimization
network-programming
oracle-sqldeveloper
gsm
service
ldap
readdir
ebay-api
cryengine
arguments
singleton
query-string
artifactory
localhost
multipartform-data
gnuradio
jquery-select2
clip-path
sitemap
samsung-gear-s2
sahi
obd-ii
spring-data-solr
react-select
samba
wallet
django-rest-auth
caldav
summernote
dev-c++
beaker-notebook
tcpdf
screen-scraping
pushbullet
quality-center
rollupjs
gulp-jshint
proof-general
resx
ocl
concrete5
keil
circle
jsonapi-resources
yelp
mybatis-generator
armadillo
inner-join
synchronized
activeandroid
geminabox
hdpi
denodo
ng-class
gige-sdk
selection-sort
dynatable
acceleo
pyautogui
google-scholar
breadcrumbs
stripes
boost-range
rowname
deck.js
scriptengine
vga
csc
jmh
google-finance-api
yfiles
ios8-share-extension
maven-antrun-plugin
uinavigationitem
bootstrap-tabs
vensim
euro
opennebula
valdr-bean-validation
accpac
parsefloat
dotcmis
angular-file-upload
pyalgotrade
pidgin
data-layers
ironworker
listpicker
maven-webstart-plugin
dynamic-expresso
backbone-views
asp.net-4.0
symbian3
cocotron
ftpwebrequest
string-length
gssapi
certificate-revocation
django-admin-tools
mvcmailer
copyfile
object-tag
cinder
pitch-shifting
code-golf
carbon-emacs
konsole
dynamic-scope
dojox.gfx
script-tag
expander
weak-typing
tracd

Resources

Encrypt Message