Comments (10)
You forgot the rule for .css files and you probably forgot to remove the sass-loader by copying the plugin used for sass
Try to update your repo with the latest version of it and try this config (not tested):
require('babel-polyfill');
// Webpack config for development
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var helpers = require('./helpers');
var assetsPath = path.resolve(__dirname, '../static/dist');
var host = (process.env.HOST || 'localhost');
var port = (+process.env.PORT + 1) || 3001;
// https://github.com/halt-hammerzeit/webpack-isomorphic-tools
var WebpackIsomorphicToolsPlugin = require('webpack-isomorphic-tools/plugin');
var webpackIsomorphicToolsPlugin = new WebpackIsomorphicToolsPlugin(require('./webpack-isomorphic-tools'));
var babelrc = fs.readFileSync('./.babelrc');
var babelrcObject = {};
try {
babelrcObject = JSON.parse(babelrc);
} catch (err) {
console.error('==> ERROR: Error parsing your .babelrc.');
console.error(err);
}
var babelrcObjectDevelopment = babelrcObject.env && babelrcObject.env.development || {};
// merge global and dev-only plugins
var combinedPlugins = babelrcObject.plugins || [];
combinedPlugins = combinedPlugins.concat(babelrcObjectDevelopment.plugins);
var babelLoaderQuery = Object.assign({}, babelrcObject, babelrcObjectDevelopment, { plugins: combinedPlugins });
delete babelLoaderQuery.env;
babelLoaderQuery.presets = babelLoaderQuery.presets.map(function (v) {
return v === 'es2015' ? ['es2015', { modules: false }] : v;
});
var validDLLs = helpers.isValidDLLs('vendor', assetsPath);
if (process.env.WEBPACK_DLLS === '1' && !validDLLs) {
process.env.WEBPACK_DLLS = '0';
console.warn('webpack dlls disabled');
}
var webpackConfig = module.exports = {
devtool: 'inline-source-map',
context: path.resolve(__dirname, '..'),
entry: {
'main': [
'webpack-hot-middleware/client?path=http://' + host + ':' + port + '/__webpack_hmr',
'react-hot-loader/patch',
'bootstrap-loader',
'font-awesome-webpack!./src/theme/font-awesome.config.js',
'./src/client.js'
]
},
output: {
path: assetsPath,
filename: '[name]-[hash].js',
chunkFilename: '[name]-[chunkhash].js',
publicPath: 'http://' + host + ':' + port + '/dist/'
},
performance: {
hints: false
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'happypack/loader?id=jsx',
include: [path.resolve(__dirname, '../src')]
}, {
test: /\.json$/,
loader: 'happypack/loader?id=json',
include: [path.resolve(__dirname, '../src')]
}, {
test: /\.less$/,
loader: 'happypack/loader?id=less',
include: [path.resolve(__dirname, '../src')]
}, {
test: /\.scss$/,
loader: 'happypack/loader?id=sass',
include: [path.resolve(__dirname, '../src')]
}, {
test: /\.css$/,
loader: 'happypack/loader?id=css',
include: [path.resolve(__dirname, '../src')]
}, {
test: /\.woff2?(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader',
options: {
limit: 10240,
mimetype: 'application/font-woff'
}
}, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader',
options: {
limit: 10240,
mimetype: 'application/octet-stream'
}
}, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file-loader'
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader',
options: {
limit: 10240,
mimetype: 'image/svg+xml'
}
}, {
test: webpackIsomorphicToolsPlugin.regular_expression('images'),
loader: 'url-loader',
options: {
limit: 10240
}
}
]
},
resolve: {
modules: [
'src',
'node_modules'
],
extensions: ['.json', '.js', '.jsx']
},
plugins: [
// hot reload
new webpack.HotModuleReplacementPlugin(),
new webpack.IgnorePlugin(/webpack-stats\.json$/),
new webpack.DefinePlugin({
__CLIENT__: true,
__SERVER__: false,
__DEVELOPMENT__: true,
__DEVTOOLS__: true // <-------- DISABLE redux-devtools HERE
}),
webpackIsomorphicToolsPlugin.development(),
new webpack.LoaderOptionsPlugin({
test: /\.jsx?$/,
happy: { id: 'jsx' }
}),
new webpack.LoaderOptionsPlugin({
test: /\.less$/,
happy: { id: 'less' }
}),
new webpack.LoaderOptionsPlugin({
test: /\.scss$/,
happy: { id: 'sass' }
}),
new webpack.LoaderOptionsPlugin({
test: /\.css$/,
happy: { id: 'css' }
}),
helpers.createHappyPlugin('jsx', [
{
loader: 'react-hot-loader/webpack'
}, {
loader: 'babel-loader',
query: babelLoaderQuery
}, {
loader: 'eslint-loader'
}
]),
helpers.createHappyPlugin('less', [
{
loader: 'style-loader'
}, {
loader: 'css-loader',
query: {
modules: true,
importLoaders: 2,
sourceMap: true,
localIdentName: '[local]___[hash:base64:5]'
}
}, {
loader: 'autoprefixer-loader',
query: {
browser: 'last 2 version'
}
}, {
loader: 'less-loader',
query: {
outputStyle: 'expanded',
sourceMap: true
}
}
]),
helpers.createHappyPlugin('sass', [
{
loader: 'style-loader'
}, {
loader: 'css-loader',
query: {
modules: true,
importLoaders: 2,
sourceMap: true,
localIdentName: '[local]___[hash:base64:5]'
}
}, {
loader: 'autoprefixer-loader',
query: {
browsers: 'last 2 version'
}
}, {
loader: 'sass-loader',
query: {
outputStyle: 'expanded',
sourceMap: true
}
}
]),
helpers.createHappyPlugin('css', [
{
loader: 'style-loader'
}, {
loader: 'css-loader',
query: {
modules: false,
importLoaders: 1,
sourceMap: true,
localIdentName: '[local]___[hash:base64:5]'
}
}, {
loader: 'autoprefixer-loader',
query: {
browsers: 'last 2 version'
}
}
])
]
};
if (process.env.WEBPACK_DLLS === '1' && validDLLs) {
helpers.installVendorDLL(webpackConfig, 'vendor');
}
from react-redux-universal-hot-example.
@bertho-zero Sorry, i updated rule for .css like your file and run "npm i" successful. But it's still errors like this
[2] ==> 🌎 API is running on port 3030
[2] ==> 💻 Send requests to http://localhost:3030
[1] [webpack-isomorphic-tools] [error] asset not found: ./node_modules/universal_components/lib/components/AppHeader/styles.scss
[1] [webpack-isomorphic-tools] [error] asset not found: ./node_modules/universal_components/assets/Style.scss
[1] [webpack-isomorphic-tools] [error] asset not found: ./node_modules/universal_components/lib/components/AppFooter/styles.scss
[1] [webpack-isomorphic-tools] [error] asset not found: ./node_modules/react-input-range/dist/react-input-range.css
[1] ----
[1] ==> ✅ (development) is running.
[1] ==> 💻 Open http://localhost:3000 in a browser to view the app.
[0] ./~/react-input-range/dist/react-input-range.css
[0] Module parse failed: /Users/anhdn/IdeaProjects/chotot-oneweb/node_modules/react-input-range/dist/react-input-range.css Unexpected token (1:0)
[0] You may need an appropriate loader to handle this file type.
[0] | .InputRange-slider {
[0] | -webkit-appearance: none;
[0] | -moz-appearance: none;
[0] @ ./src/components/FilterOverlay/index.js 65:0-55
[0] @ ./src/components/index.js
[0] @ ./src/containers/AdvancedFilterPopup/index.js
[0] @ ./src/containers/index.js
[0] @ ./src/routes.js
[0] @ ./src/client.js
[0] @ multi webpack-hot-middleware/client?path=http://localhost:3001/__webpack_hmr react-hot-loader/patch bootstrap-loader font-awesome-webpack!./src/theme/font-awesome.config.js ./src/client.js
from react-redux-universal-hot-example.
i add extensions: ['less', 'scss','css'] to handle css file on webpack-isomorphic-tools.js
from react-redux-universal-hot-example.
@bertho-zero I can run on production but on development it has errors like that. Do you have any suggestion?
from react-redux-universal-hot-example.
It's an error due to rc version of extract-text-webpack-plugin, try to down your version at the 2.0.0-beta.5.
npm i [email protected] -D
from react-redux-universal-hot-example.
i updated npm i [email protected] -D
but still errors. It might like this issue webpack-contrib/sass-loader#69
from react-redux-universal-hot-example.
{
test: /\.scss$/,
loader: 'happypack/loader?id=sass',
include: [path.resolve(__dirname, '../src'), path.resolve(__dirname, '../node_modules/')]
}
I include node_modules to build sass to Solve the issue. @bertho-zero thank you!
from react-redux-universal-hot-example.
Do you guest the issue while "npm run dev" succcess?
from react-redux-universal-hot-example.
Normally you should not see all this if the DLLs file is not created,
You can run npm run build-dlls
for replace it.
Normally you have this: https://github.com/bertho-zero/react-redux-universal-hot-example/blob/master/webpack/dev.config.js#L40L44
from react-redux-universal-hot-example.
@bertho-zero thank you! It's cache of webpack dll. I clear and it works!
from react-redux-universal-hot-example.
Related Issues (20)
- An in-range update of eslint-plugin-react is breaking the build 🚨 HOT 3
- An in-range update of @babel/runtime-corejs3 is breaking the build 🚨 HOT 3
- An in-range update of babel7 is breaking the build 🚨 HOT 2
- An in-range update of final-form is breaking the build 🚨 HOT 5
- An in-range update of webpack is breaking the build 🚨 HOT 18
- An in-range update of eslint-plugin-react is breaking the build 🚨 HOT 8
- issues updating bootstrap 3 to bootstrap 4
- Failing to send authentication credentials to custom API HOT 1
- An in-range update of js-cookie is breaking the build 🚨 HOT 1
- Chrome caches API requests when nginx is set as reversed proxy HOT 2
- An in-range update of react-redux is breaking the build 🚨 HOT 4
- An in-range update of history is breaking the build 🚨 HOT 2
- An in-range update of @babel/runtime-corejs3 is breaking the build 🚨 HOT 10
- An in-range update of babel7 is breaking the build 🚨
- An in-range update of babel7 is breaking the build 🚨 HOT 33
- An in-range update of core-js is breaking the build 🚨 HOT 5
- Using bootstrap 4 and dependencies outdated
- Running Tests - Mocha on the Backend - Feathers Sequelize
- Update HOT 2
- Authentication Pattern HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-redux-universal-hot-example.