方诺官网改正版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

59 line
1.5 KiB

  1. const webpack = require("webpack");
  2. const path = require("path");
  3. const CKEditorWebpackPlugin = require("@ckeditor/ckeditor5-dev-webpack-plugin");
  4. const { styles } = require("@ckeditor/ckeditor5-dev-utils");
  5. module.exports = {
  6. publicPath:process.env.NODE_ENV=="production"?"./":"/", //打包配置,解决页面空白的配置方案。
  7. devServer: {
  8. open: true, //是否自动弹出浏览器页面
  9. https: false,
  10. hotOnly: false,
  11. proxy: {
  12. '/api': {
  13. target: 'http://192.168.0.123:8080', //API服务器的地址
  14. ws: true, //代理websockets
  15. changeOrigin: true, // 虚拟的站点需要更管origin
  16. pathRewrite: {
  17. '^/api': '/'
  18. }
  19. }
  20. },
  21. },
  22. configureWebpack: {
  23. plugins: [
  24. new webpack.ProvidePlugin({
  25. cash: "cash-dom"
  26. }),
  27. new CKEditorWebpackPlugin({
  28. language: "en",
  29. translationsOutputFile: /app/
  30. })
  31. ],
  32. },
  33. transpileDependencies: [/ckeditor5-[^/\\]+[/\\]src[/\\].+\.js$/],
  34. chainWebpack: config => {
  35. const svgRule = config.module.rule("svg");
  36. svgRule.exclude.add(path.join(__dirname, "node_modules", "@ckeditor"));
  37. config.module
  38. .rule("cke-svg")
  39. .test(/ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/)
  40. .use("raw-loader")
  41. .loader("raw-loader");
  42. config.module
  43. .rule("cke-css")
  44. .test(/ckeditor5-[^/\\]+[/\\].+\.css$/)
  45. .use("postcss-loader")
  46. .loader("postcss-loader")
  47. .tap(() => {
  48. return styles.getPostCssConfig({
  49. themeImporter: {
  50. themePath: require.resolve("@ckeditor/ckeditor5-theme-lark")
  51. },
  52. minify: true
  53. });
  54. });
  55. }
  56. };