Open arsendev opened 4 years ago
Hey @arsendev I'm trying to set this up with next too. Any luck getting it to work?
Hi!! @ryanrouleau I solved the problem by adding a conditional statement as the code below, but I don't know why it works.
However, it worked correctly only if you put the condition statement before 'require'.
if (typeof require !== "undefined") {
require.extensions[".less"] = () => { };
require.extensions[".css"] = (file) => { };
}
const withSass = require('@zeit/next-sass');
const withCss = require('@zeit/next-css');
const path = require('path');
config.module.rules.push(
{
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader',
include: path.join(__dirname, 'node_modules'),
exclude: /flexboxgrid/,
options: {
modules: false,
importLoaders: 1,
localIdentName: '[local]__[hash:base64:5]'
}
},
{
test: /\.(jpe?g|png|svg|gif|eot|ttf|woff|woff2)$/,
use: [
{
loader: 'file-loader',
options: {
exclude: /node_modules/,
publicPath: process.env.S3_URL ? process.env.S3_URL + '/_next/static/images/' : '/_next/static/images/',
outputPath: 'static/images/',
name: '[name]-[hash].[ext]'
}
}
]
}
Hello, I'd like to use [react-flexbox-grid] to do my work now. I'm working on next.js. No different. I'd like to set it up in [next.config.js], but it keeps failing.
I use style file as [scss].
this is next.config.js file
err msg
I tried the tutorial, but it keeps going up.