forked from Gitlink/forgeplus-react
55 lines
2.0 KiB
TypeScript
55 lines
2.0 KiB
TypeScript
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
|
|
|
|
const chainWebpack = (config: any) => {
|
|
//
|
|
// config.module.noParse = /jquery/;
|
|
config.plugin('monaco-editor').use(new MonacoWebpackPlugin({
|
|
globalAPI: true,
|
|
features: ["accessibilityHelp", "bracketMatching", "caretOperations", "clipboard", "codeAction", "codelens", "colorDetector", "comment", "contextmenu", "coreCommands", "cursorUndo", "dnd", "find", "folding", "fontZoom", "format", "gotoError", "gotoLine", "gotoSymbol", "hover", "iPadShowKeyboard", "inPlaceReplace", "inspectTokens", "linesOperations", "links", "multicursor", "parameterHints", "quickCommand", "quickOutline", "referenceSearch", "rename", "smartSelect", "snippets", "suggest", "toggleHighContrast", "toggleTabFocusMode", "transpose", "wordHighlighter", "wordOperations", "wordPartOperations"],
|
|
}))
|
|
|
|
if (process.env.API_ENV !== 'dev') {
|
|
// config.merge({
|
|
// optimization: {
|
|
// minimize: true,
|
|
// splitChunks: {
|
|
// chunks: 'all',
|
|
// minSize: 30000,
|
|
// minChunks: 3,
|
|
// automaticNameDelimiter: '.',
|
|
// cacheGroups: {
|
|
// vendor: {
|
|
// name: 'vendors',
|
|
// test({ resource }) {
|
|
// return /[\\/]node_modules[\\/]/.test(resource)
|
|
// },
|
|
// priority: 10,
|
|
// },
|
|
// },
|
|
// },
|
|
// }
|
|
// })
|
|
|
|
// config
|
|
// .plugin('d1-ignore')
|
|
// .use(
|
|
// // eslint-disable-next-line
|
|
// require('webpack/lib/IgnorePlugin'), [
|
|
// /^((fs)|(path)|(os)|(crypto)|(source-map-support))$/, /vs(\/|\\)language(\/|\\)typescript(\/|\\)lib/
|
|
// ]
|
|
// )
|
|
// .end()
|
|
// .plugin('d1-replace')
|
|
// .use(
|
|
// // eslint-disable-next-line
|
|
// require('webpack/lib/ContextReplacementPlugin'),
|
|
// [
|
|
// /monaco-editor(\\|\/)esm(\\|\/)vs(\\|\/)editor(\\|\/)common(\\|\/)services/,
|
|
// __dirname,
|
|
// ]
|
|
// )
|
|
}
|
|
|
|
return config
|
|
}
|
|
export default chainWebpack;
|