Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

"Binding static in strict mode" #21

@chpio

Description

@chpio

hi,

SyntaxError: .../node_modules/express/lib/express.js: Binding static in strict mode (120:11)
  118 | 
  119 | export default express;
> 120 | export var static = express.static;
      |            ^
  121 | export var query = express.query;
  122 | export var Router = express.Router;
  123 | export var Route = express.Route;

my build script:

    const plugins = [
        'external-helpers-2',
        'transform-async-to-generator',
        'transform-function-bind',
    ];

    const presets = ['es2015-rollup'];

    const bundle = await rollup({
        entry: './src/index.js',
        plugins: [
            rollupNpm({jsnext: true, main: true}),
            rollupCjs(),
            rollupBabel({
                babelrc: false,
                presets,
                plugins,
            }),
        ],
    });

    await bundle.write({
        format: 'es5',
        dest: `./index.js`,
        sourceMap: 'inline',
    });

i think, rollup cjs produces illegal code (es2015 modules with "use strict"), this causes babel to throw an error.

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