Skip to content

Feature Request: do not transform build-in require function #248

@axetroy

Description

@axetroy

Since nuxt.config.js is not packaged, the require will throw an error

const ROOT_DIR = rootDir || process.env.ROOT_DIR || process.cwd()
- const config = require(path.join(ROOT_DIR, 'nuxt.config.js'))
+ const config = __webpack_require__(7083)(path.join(ROOT_DIR, 'nuxt.config.js'))

Can we keep the built-in require?

For example by adding such a comment

const config = /*ncc-build-in-require*/ require(path.join(ROOT_DIR, 'nuxt.config.js'));

Although this job seems to be webpack

But if do it with a plugin, that will be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions