UNPKG

@omni-door/tpl-ssr-react

Version:
10 lines (9 loc) 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.tpl_next_config = void 0; var utils_1 = require("@omni-door/utils"); var tpl = "`${use_strict}\n/** @type {import('next').NextConfig} */\n\nconst path = require('path');\nconst withLess = require('next-with-less');\nconst withTM = require('next-transpile-modules');\nconst withPlugin = require('next-compose-plugins');\nconst withBundleAnalyzer = require('@next/bundle-analyzer')({\n enabled: process.env.ANALYZE === 'true'\n});\nconst merge = require('webpack-merge');\nconst webpackConfig = require('./configs/webpack.config.js');\nconst configs = require('./configs/omni.config');\nconst isProd = process.env.NODE_ENV === 'production';\n\nmodule.exports = withPlugin([\n withLess({\n lessLoaderOptions: {\n javascriptEnabled: true\n }\n }),\n withTM([]),\n withBundleAnalyzer\n], {\n // assetPrefix: isProd ? 'https://cdn.domain.com' : '',\n target: 'server',\n compress: true,\n poweredByHeader: false,\n generateEtags: true,\n distDir: path.relative(__dirname, configs.build.outDir) || 'dist',\n reactStrictMode: true,\n webpack: config => merge(config, webpackConfig)\n});\n`"; exports.tpl_next_config = { tpl: tpl }; exports.default = utils_1.tplEngineInit(exports.tpl_next_config, 'tpl');