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

require package 各种错误啊 #33

Open
xiaoDC opened this issue Feb 7, 2017 · 0 comments
Open

require package 各种错误啊 #33

xiaoDC opened this issue Feb 7, 2017 · 0 comments

Comments

@xiaoDC
Copy link

xiaoDC commented Feb 7, 2017

Error: Cannot find module '../node_modules/babel-preset-es2015'
at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at _transform_react (/Users/fri3nds/coding/react-native-examples/AwesomeProject/node_modules/moles-packer/lib/transform.js:139:22)

我个人是用 npm script 来用的,

 "deploy": "moles-packer --entry index.ios.js --platform ios --standlone --output ./build --verbose"

首先是 yuancon 莫名其妙的只调用 node_modules 下的 react-native 命令,然后是
node_modules/moles-packer/lib/transform.js 中为什么 require babel plugin 相对路径

    console.log(process.cwd(), __dirname, '============');
    var result = babel.transform(info.code, {
        'presets': [ require('../node_modules/babel-preset-es2015'), require('../node_modules/babel-preset-stage-0'), require('../node_modules/babel-preset-react') ],
        'plugins': [ require('../node_modules/babel-plugin-transform-es5-property-mutators'), require('../node_modules/babel-plugin-transform-class-properties') ]
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant