How to use the @uifabric/monaco-editor/scripts/addMonacoWebpackConfig.addMonacoWebpackConfig function in @uifabric/monaco-editor

To help you get started, we’ve selected a few @uifabric/monaco-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / office-ui-fabric-react / packages / tsx-editor / webpack.config.js View on Github external
// @ts-check
const path = require('path');
const resources = require('@uifabric/build/webpack/webpack-resources');
const { addMonacoWebpackConfig } = require('@uifabric/monaco-editor/scripts/addMonacoWebpackConfig');

const BUNDLE_NAME = 'tsx-editor';
const IS_PRODUCTION = process.argv.indexOf('--production') > -1;

module.exports = resources.createConfig(
  BUNDLE_NAME,
  IS_PRODUCTION,
  addMonacoWebpackConfig({
    entry: {
      [BUNDLE_NAME]: './lib/index.js'
    },

    output: {
      libraryTarget: 'var',
      library: 'FabricTsxEditor'
    },

    externals: [{ react: 'React' }, { 'react-dom': 'ReactDOM' }],

    resolve: {
      alias: {
        '@uifabric/tsx-editor/src': path.join(__dirname, 'src'),
        '@uifabric/tsx-editor/lib': path.join(__dirname, 'lib'),
        '@uifabric/tsx-editor/dist': path.join(__dirname, 'dist'),
github OfficeDev / office-ui-fabric-react / packages / tsx-editor / webpack.serve.config.js View on Github external
// @ts-check
const path = require('path');
const resources = require('@uifabric/build/webpack/webpack-resources');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const { addMonacoWebpackConfig } = require('@uifabric/monaco-editor/scripts/addMonacoWebpackConfig');

const BUNDLE_NAME = 'demo-app';

module.exports = resources.createServeConfig(
  addMonacoWebpackConfig({
    entry: {
      [BUNDLE_NAME]: './src/demo/index.tsx'
    },

    output: {
      chunkFilename: `${BUNDLE_NAME}-[name].js`
    },

    devServer: {
      writeToDisk: true // for debugging
    },

    externals: {
      react: 'React',
      'react-dom': 'ReactDOM'
    },

@uifabric/monaco-editor

Version of monaco-editor with configuration helpers and transformed CSS files

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis

Similar packages