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

"Binding static in strict mode" #21

Closed
chpio opened this issue Dec 13, 2015 · 0 comments
Closed

"Binding static in strict mode" #21

chpio opened this issue Dec 13, 2015 · 0 comments

Comments

@chpio
Copy link

chpio commented Dec 13, 2015

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.

Rich-Harris added a commit that referenced this issue Dec 28, 2015
blacklist all reserved words as export names
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant