mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
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
This commit is contained in:
parent
3c0876ceae
commit
56f52db5a9
|
@ -1,7 +1,12 @@
|
||||||
|
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 = {
|
||||||
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue