方诺官网改正版
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.
 
 
 

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