xiao252 / with-ssr-entry

next.js - solve the problem of syntaxError: Invalid or unexpected token

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

with-ssr-entry

xiaoxiaojx/blog#40

// Fix the following problem with the build in next.js

> Build error occurred
{ /xxx/node_modules/pkg/index.scss:1
$color: #4c9ffe;
                      ^

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:723:23)

install

yarn add with-ssr-entry

example

// next.config.js

const withSsrEntry = require('with-ssr-entry')
module.exports = withSsrEntry() // like withCss, withSass

About

next.js - solve the problem of syntaxError: Invalid or unexpected token


Languages

Language:TypeScript 100.0%