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

[!] Error: 'named' is not exported by src/example5/module5.js #267

Closed
qiqihaobenben opened this issue Dec 20, 2017 · 1 comment
Closed

Comments

@qiqihaobenben
Copy link

I try to write a demo according to the example you gave,the code is as follows

// rollup.config.js
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';

export default {
    input: 'src/example5/main.js',
    output: {
        file: 'dist/example5/bundle.js',
        format: 'cjs'
    },
    plugins: [
        resolve({
            jsnext: true,
            main: true
        }),
        commonjs()
    ]
}

// src/example5/main.js
import { named } from './module5.js';
export default function () {
    console.log(named);
}

The problem is “src/example5/module5.js”

// this is ok
exports.named = 'cfangxu';

// if i write this, Terminal error:'named' is not exported by src/example5/module5.js
module.exports = {named: 'cfangxu'};

Thank you in advance for your answer

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

2 participants