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

"Binding static in strict mode" #21

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

Comments

Projects
None yet
1 participant
@chpio
Copy link

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.

@chpio chpio referenced this issue Dec 13, 2015

Closed

Illegal imports #355

Rich-Harris added a commit that referenced this issue Dec 28, 2015

Merge pull request #26 from rollup/gh-21
blacklist all reserved words as export names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.