Skip to content

Import and require not work #1

@georgezouq

Description

@georgezouq

Import this package into my project (rollup) in this way:

import { generate } from '@arco-design/color';

Error: SyntaxError: Cannot use import statement outside a module

And I see in arco-design project palette.js, it uses require to import package

const { generate } = require('@arco-design/color');

And stall, it does not work for me

Error: Cannot find module '@arco-design/color'

I am not sure if this is because commonjs project is import into esnext project.
Should this package publish in the build version instance source code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions