小编Jor*_*llo的帖子

缩小/优化 NextJS 站点

我有一个 nextjs 网站。

我的 common.js 和我的 custom.scss 不会被 next 缩小。

我在 next.config.js 中尝试了下一个:

const withSass = require('@zeit/next-sass')
const withOptimizedImages = require('next-optimized-images');
const withTypescript = require('@zeit/next-typescript')
module.exports = withSass({minified:true},withOptimizedImages(withTypescript()))
Run Code Online (Sandbox Code Playgroud)

我的 .babelrc

{
    "presets": [
        "next/babel",
        "@zeit/next-typescript/babel",
        "minify"
    ]
}
Run Code Online (Sandbox Code Playgroud)

我的 tsconfig.json

{
    "compilerOptions": {
        "allowJs": true,
        "allowSyntheticDefaultImports": true,
        "jsx": "preserve",
        "lib": [
            "dom",
            "es2017"
        ],
        "module": "esnext",
        "moduleResolution": "node",
        "noEmit": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "preserveConstEnums": true,
        "removeComments": true,
        "skipLibCheck": true,
        "sourceMap": true,
        "strict": true,
        "target": "esnext"
    }
}
Run Code Online (Sandbox Code Playgroud)

它应该工作还是我必须实施更多的东西?

reactjs webpack babeljs next.js

3
推荐指数
2
解决办法
1万
查看次数

标签 统计

babeljs ×1

next.js ×1

reactjs ×1

webpack ×1