From aa3b0d118e4340af9c7805c5666c03931e832298 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sat, 3 Aug 2024 02:22:25 +0800 Subject: [PATCH] chore: add example #269 --- examples/#269/.kktrc.ts | 11 +++++++++ examples/#269/package.json | 34 ++++++++++++++++++++++++++++ examples/#269/public/index.html | 17 ++++++++++++++ examples/#269/src/example.tsx | 34 ++++++++++++++++++++++++++++ examples/#269/src/index.tsx | 7 ++++++ examples/#269/src/react-app-env.d.ts | 1 + examples/#269/tsconfig.json | 7 ++++++ lerna.json | 2 +- package.json | 1 + website/package.json | 1 - 10 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 examples/#269/.kktrc.ts create mode 100644 examples/#269/package.json create mode 100644 examples/#269/public/index.html create mode 100644 examples/#269/src/example.tsx create mode 100644 examples/#269/src/index.tsx create mode 100644 examples/#269/src/react-app-env.d.ts create mode 100644 examples/#269/tsconfig.json diff --git a/examples/#269/.kktrc.ts b/examples/#269/.kktrc.ts new file mode 100644 index 00000000..98627546 --- /dev/null +++ b/examples/#269/.kktrc.ts @@ -0,0 +1,11 @@ +import { LoaderConfOptions, WebpackConfiguration } from 'kkt'; + +export default (conf: WebpackConfiguration, env: 'production' | 'development', options: LoaderConfOptions) => { + conf.ignoreWarnings = [{ module: /node_modules[\\/]parse5[\\/]/ }]; + // https://github.com/kktjs/kkt/issues/336#issue-1097660932 + conf.module!.exprContextCritical = false; + if (env === 'production') { + conf.output = { ...conf.output, publicPath: './' }; + } + return conf; +}; diff --git a/examples/#269/package.json b/examples/#269/package.json new file mode 100644 index 00000000..8ceaa5a7 --- /dev/null +++ b/examples/#269/package.json @@ -0,0 +1,34 @@ +{ + "name": "@examples/269", + "version": "5.1.1", + "private": true, + "scripts": { + "build": "kkt build", + "start": "kkt start" + }, + "dependencies": { + "react": "~18.2.0", + "react-dom": "~18.2.0", + "rehype-sanitize": "^6.0.0" + }, + "devDependencies": { + "@kkt/less-modules": "^7.4.7", + "@kkt/scope-plugin-options": "^7.4.7", + "kkt": "^7.4.7" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/examples/#269/public/index.html b/examples/#269/public/index.html new file mode 100644 index 00000000..972ba7fd --- /dev/null +++ b/examples/#269/public/index.html @@ -0,0 +1,17 @@ + + + +
+ + + +