webpack-cross-origin.config.js 775 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const MonacoWebpackPlugin = require('../out/index.js');
  2. const path = require('path');
  3. const ASSET_PATH = 'http://localhost:8088/monaco-editor/test/smoke/webpack/out/';
  4. const REPO_ROOT = path.join(__dirname, '../../');
  5. module.exports = {
  6. mode: 'development',
  7. entry: './index.js',
  8. context: __dirname,
  9. output: {
  10. path: path.resolve(REPO_ROOT, 'test/smoke/webpack/out'),
  11. filename: 'app.js',
  12. publicPath: ASSET_PATH
  13. },
  14. resolve: {
  15. alias: {
  16. 'monaco-editor': path.resolve(REPO_ROOT, 'release')
  17. }
  18. },
  19. module: {
  20. rules: [
  21. {
  22. test: /\.css$/,
  23. use: ['style-loader', 'css-loader']
  24. },
  25. {
  26. test: /\.ttf$/,
  27. use: ['file-loader']
  28. }
  29. ]
  30. },
  31. plugins: [
  32. new MonacoWebpackPlugin({
  33. monacoEditorPath: path.resolve(REPO_ROOT, 'release')
  34. })
  35. ]
  36. };