-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update dependency kkt to v7.5.0
- Loading branch information
1 parent
8288e1b
commit a0d00ba
Showing
11 changed files
with
111 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import path from 'path'; | ||
import { Configuration } from 'webpack'; | ||
import { OptionConf } from 'kkt/lib/config/webpack.config'; | ||
import { LoaderConfOptions, WebpackConfiguration } from 'kkt'; | ||
import lessModules from '@kkt/less-modules'; | ||
import scopePluginOptions from '@kkt/scope-plugin-options'; | ||
|
||
export const moduleScopePluginOpts = [ | ||
path.resolve(process.cwd(), 'data.json'), | ||
]; | ||
|
||
export const loaderOneOf = [ | ||
[require.resolve('@kkt/loader-less'), {}], | ||
]; | ||
|
||
|
||
export default (conf: Configuration, opts: OptionConf, webpack) => { | ||
if (opts.isEnvProduction) { | ||
conf.output.publicPath = './'; | ||
export default (conf: WebpackConfiguration, env: 'development' | 'production', options: LoaderConfOptions) => { | ||
conf = lessModules(conf, env, options); | ||
conf = scopePluginOptions(conf, env, { | ||
...options, | ||
allowedFiles: [path.resolve(process.cwd(), 'data.json')], | ||
}); | ||
if (env === 'production') { | ||
conf.output = { ...conf.output, publicPath: './' }; | ||
} | ||
return conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './app/App'; | ||
import reportWebVitals from './reportWebVitals'; | ||
import ReactClient from 'react-dom/client'; | ||
import './index.css'; | ||
import * as serviceWorker from './serviceWorker'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
ReactClient.createRoot(document.getElementById('root')!).render(<App />); | ||
|
||
|
||
// If you want your app to work offline and load faster, you can change | ||
// unregister() to register() below. Note this comes with some pitfalls. | ||
// Learn more about service workers: https://bit.ly/CRA-PWA | ||
serviceWorker.unregister(); | ||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// <reference types="react-scripts" /> | ||
|
||
declare module '*.module.less' { | ||
const classes: { readonly [key: string]: string }; | ||
export default classes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const reportWebVitals = (onPerfEntry?: any) => { | ||
if (onPerfEntry && onPerfEntry instanceof Function) { | ||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { | ||
getCLS(onPerfEntry); | ||
getFID(onPerfEntry); | ||
getFCP(onPerfEntry); | ||
getLCP(onPerfEntry); | ||
getTTFB(onPerfEntry); | ||
}); | ||
} | ||
}; | ||
|
||
export default reportWebVitals; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.