Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce size of import #163

Open
Dave3of5 opened this issue Apr 24, 2019 · 1 comment
Open

Reduce size of import #163

Dave3of5 opened this issue Apr 24, 2019 · 1 comment

Comments

@Dave3of5
Copy link

Using the instructions on here I've setup my Spa to use brace (I'm using Vue.Js with webpack). I found the import size of this lib is enormous (408KB):

image

Here's my code:

import * as ace from 'brace';
import 'brace/mode/json';
import 'brace/theme/chrome';

export default {
  name: 'CodeEditor',
  props: ['value'],
  data () {
    return {
      editor: null
    };
  },
  mounted () {
    this.editor = ace.edit('code-editor');
    this.editor.getSession().setMode('ace/mode/json');
    this.editor.setTheme('ace/theme/chrome');
    this.editor.setValue(this.value);
    this.editor.setShowPrintMargin(false);

    this.editor.getSession().on('change', () => {
      this.$emit('input', this.editor.getValue());
    });
  }
};

The Import * as ace is the problem here. Do you know what the minimum setup of modules I need to support the above is ?

@JakeStanger
Copy link

Could we also see UMD support or similar? I'm stuck including Brace in my main bundle at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants