summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-06-08 06:53:54 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-06-08 06:53:54 +0000
commit9d285f1fef0ca66da16b7c0ba42f50071dab73ab (patch)
tree53e2f68c4c6e7f64f35f706ae57caa4dead3c15c /config
parent5652b3aad99e73d5ea33f5f310d6bee85654634c (diff)
parenteeafa8ac354a74e945d1fc7c9a5cfa039898a9af (diff)
downloadgitlab-ce-9d285f1fef0ca66da16b7c0ba42f50071dab73ab.tar.gz
Merge branch '44331-upgrade-monaco-editor-and-remove-copywebpackplugin' into 'master'2018-06-07-code-freeze-ee2018-06-07-code-freeze
Resolve "Upgrade Monaco editor and remove CopyWebpackPlugin" Closes #44331 See merge request gitlab-org/gitlab-ce!17813
Diffstat (limited to 'config')
-rw-r--r--config/dependency_decisions.yml6
-rw-r--r--config/webpack.config.js36
2 files changed, 10 insertions, 32 deletions
diff --git a/config/dependency_decisions.yml b/config/dependency_decisions.yml
index 6616b85129e..21c20cd5e93 100644
--- a/config/dependency_decisions.yml
+++ b/config/dependency_decisions.yml
@@ -534,3 +534,9 @@
:why: https://github.com/squaremo/bitsyntax-js/blob/master/LICENSE-MIT
:versions: []
:when: 2018-02-20 22:20:25.958123000 Z
+- - :approve
+ - "@webassemblyjs/ieee754"
+ - :who: Mike Greiling
+ :why: https://github.com/xtuc/webassemblyjs/blob/master/LICENSE
+ :versions: []
+ :when: 2018-06-08 05:30:56.764116000 Z
diff --git a/config/webpack.config.js b/config/webpack.config.js
index d6ab32972fb..e760ce1cb8c 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -4,8 +4,8 @@ const glob = require('glob');
const webpack = require('webpack');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;
-const CopyWebpackPlugin = require('copy-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
+const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const ROOT_PATH = path.resolve(__dirname, '..');
@@ -168,15 +168,7 @@ module.exports = {
name: '[name].[hash:8].[ext]',
},
},
- {
- test: /monaco-editor\/\w+\/vs\/loader\.js$/,
- use: [
- { loader: 'exports-loader', options: 'l.global' },
- { loader: 'imports-loader', options: 'l=>{},this=>l,AMDLoader=>this,module=>undefined' },
- ],
- },
],
- noParse: [/monaco-editor\/\w+\/vs\//],
},
optimization: {
@@ -226,6 +218,9 @@ module.exports = {
// enable vue-loader to use existing loader rules for other module types
new VueLoaderPlugin(),
+ // automatically configure monaco editor web workers
+ new MonacoWebpackPlugin(),
+
// prevent pikaday from including moment.js
new webpack.IgnorePlugin(/moment/, /pikaday/),
@@ -235,29 +230,6 @@ module.exports = {
jQuery: 'jquery',
}),
- // copy pre-compiled vendor libraries verbatim
- new CopyWebpackPlugin([
- {
- from: path.join(
- ROOT_PATH,
- `node_modules/monaco-editor/${IS_PRODUCTION ? 'min' : 'dev'}/vs`
- ),
- to: 'monaco-editor/vs',
- transform: function(content, path) {
- if (/\.js$/.test(path) && !/worker/i.test(path) && !/typescript/i.test(path)) {
- return (
- '(function(){\n' +
- 'var define = this.define, require = this.require;\n' +
- 'window.define = define; window.require = require;\n' +
- content +
- '\n}.call(window.__monaco_context__ || (window.__monaco_context__ = {})));'
- );
- }
- return content;
- },
- },
- ]),
-
// compression can require a lot of compute time and is disabled in CI
IS_PRODUCTION && !NO_COMPRESSION && new CompressionPlugin(),