Commit 56f52db5 authored by Watcharakrit Phantu's avatar Watcharakrit Phantu Committed by Tim Neutkens

Fixed example `with-scoped-stylesheets-and-postcss`: css-modules reload update…

Fixed example `with-scoped-stylesheets-and-postcss`: css-modules reload update from files [name].css.json. (#2110)

* Fixed: css-modules reload files styles.css.json.

* update: disable uglify for next build.

add: require('fs') for next build.
add: disable uglify on next.config.js for next build.

* Fix linting errors
parent 3c0876ce
const fs = require('fs')
const trash = require('trash') const trash = require('trash')
module.exports = { module.exports = {
webpack: (config) => { webpack: (config) => {
config.plugins = config.plugins.filter(
(plugin) => (plugin.constructor.name !== 'UglifyJsPlugin')
)
config.module.rules.push( config.module.rules.push(
{ {
test: /\.css$/, test: /\.css$/,
...@@ -17,7 +22,7 @@ module.exports = { ...@@ -17,7 +22,7 @@ module.exports = {
options: { options: {
procedure: function (content) { procedure: function (content) {
const fileName = `${this._module.userRequest}.json` const fileName = `${this._module.userRequest}.json`
const classNames = JSON.stringify(require(fileName)) const classNames = fs.readFileSync(fileName, 'utf8')
trash(fileName) trash(fileName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment