how can i use 'node_modules' directly with 'yarn berry'

Viewed 1128

i used node_modules to run a script and, copied node_modules to 'dist' to import modules

'packages.json'

"scrips":{
    "start" : "node ./node_modules/storybook/server/index.js"
}

and 'vite.config.ts'

import copy from "rollup-plugin-copy";

      copy({
            targets: [
                {
                    src: "node_modules/lit-element/",
                    dest: "dist",
                },

but with yarn berry, doesn't make 'node_modules'

so, how can i do that things before i used node_modules directly

1 Answers

You can add nodeLinker: node-modules in your .yarnrc.yml, such that the yarn will generate the node_modules directory as before.

Related