Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Use Webpack #11107

Closed
Closed

Description

Webpack allows using ES6 modules to split code instead of using global variables. It transforms ES6 modules into code that can be ran in the environment that doesn't support ES6 modules yet (for example current Chrome version). It also can use CommonJS modules like https-everywhere-rules which is a ruleset parsing library working in Node and browser, complete with Mocha unit tests, which I used to create a list of rulesets which have failed the ruleset test (#11114). It will also make developing and running unit tests for HTTPS Everywhere code easier.

Activity

  1. jeremyn commented on Jul 21, 2017

    @jeremyn
    Contributor

    I support switching the current extension build process from the current homegrown bash/Python stuff to npm+webpack+etc. This might be useful: https://github.com/mdn/webextensions-examples/tree/master/webpack-modules.

    It transforms ES6 modules into code that can be ran in the environment that doesn't support ES6 modules yet (for example current Chrome version).

    You need something like Babel for this, see https://webpack.js.org/guides/getting-started/#es2015-modules.

  2. jeremyn commented on Jul 21, 2017

    @jeremyn
    Contributor

    The link I gave to https://webpack.js.org/guides/getting-started/#es2015-modules says that Webpack transpiles import/export statements but nothing else. So if you're importing a module that only contains ES5 stuff, you're fine, but if you're importing a module that contains ES6 stuff then you need something like Babel.

    In other words, by itself Webpack can handle the ES6 module concept, but not a module that has ES6 contents. Does this match your testing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions