Merge pull request #1 from Bouncey/feat/monacoEditor
Feat/monaco editor
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
939028df20
commit
1f5abb3dde
@ -1,4 +1,6 @@
|
||||
const path = require('path');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const { dasherize } = require('./utils');
|
||||
const { viewTypes } = require('./utils/challengeTypes');
|
||||
const { blockNameify } = require('./utils/blockNameify');
|
||||
@ -84,3 +86,27 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
exports.modifyWebpackConfig = ({ config, stage, babelConfig }) => {
|
||||
if (stage === 'build-javascript' || stage === 'develop') {
|
||||
config.plugin('CopyWebpackPlugin', CopyWebpackPlugin, [
|
||||
[
|
||||
{
|
||||
from: path.resolve(__dirname, './node_modules/monaco-editor/min/vs'),
|
||||
to: 'vs'
|
||||
}
|
||||
]
|
||||
]);
|
||||
// remove the default 'js' loader so we can create our own
|
||||
config.removeLoader('js');
|
||||
// these modules are shipped with es6 code, we need to transform them due
|
||||
// to the version of the uglifyjs plugin gatsby is using
|
||||
config.loader('js', {
|
||||
test: /\.jsx?$/,
|
||||
exclude: /(node_modules|bower_components)\/(?!ansi-styles|chalk)/,
|
||||
loader: 'babel',
|
||||
query: babelConfig
|
||||
});
|
||||
}
|
||||
return config;
|
||||
};
|
||||
|
Reference in New Issue
Block a user