Skip to content

Smallest possible bundle size for Markdown #2730

@stefandobre

Description

@stefandobre

Hi there,

I'm trying to create the most minimal bundle possible for a simple markdown editor, with no extra features enabled.
Here's my configuration:

const path = require("path");
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");

module.exports = {
	mode: 'production',
	entry: "./index.js",
	output: {
		path: path.resolve(__dirname, "dist"),
		filename: "[name].bundle.js",
	},
	module: {
		rules: [{
			test: /\.css$/,
			use: ["style-loader", "css-loader",],
		}, {
			test: /\.ttf$/,
			use: ['file-loader']
		}],
	},
	plugins: [
		new MonacoWebpackPlugin({
			languages: ["markdown"],
			features: [
				'!accessibilityHelp',
				'!bracketMatching',
				'!caretOperations',
				'!clipboard',
				'!codeAction',
				'!codelens',
				'!colorDetector',
				'!comment',
				'!contextmenu',
				'!coreCommands',
				'!cursorUndo',
				'!dnd',
				'!find',
				'!folding',
				'!fontZoom',
				'!format',
				'!gotoError',
				'!gotoLine',
				'!gotoSymbol',
				'!hover',
				'!iPadShowKeyboard',
				'!inPlaceReplace',
				'!inspectTokens',
				'!linesOperations',
				'!links',
				'!multicursor',
				'!parameterHints',
				'!quickCommand',
				'!quickOutline',
				'!referenceSearch',
				'!rename',
				'!smartSelect',
				'!snippets',
				'!suggest',
				'!toggleHighContrast',
				'!toggleTabFocusMode',
				'!transpose',
				'!wordHighlighter',
				'!wordOperations',
				'!wordPartOperations'
			]
		})
	]
};

My main.bundle.js comes out at 1.5mb which seems quite big. Is this the minimum size of the editor or is there any way to slim this down even further?

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitieswebpack-plugin

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions