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

Unable to find babel plugin after path modify #12

Open
udalrich opened this issue May 9, 2017 · 0 comments
Open

Unable to find babel plugin after path modify #12

udalrich opened this issue May 9, 2017 · 0 comments

Comments

@udalrich
Copy link

udalrich commented May 9, 2017

I am running babelify with browserify in gulp by the following code:

return browserify(
    {
        // Only need initial file, browserify finds the deps
        entries: [bundlePath + '/main.jsx'],
        debug: true,
        cache: {},
        packageCache: {},
        fullPaths: true,
        paths: [ __dirname + '/node_modules', __dirname ]
    })
    .plugin(pathmodify(), {
        mods: [
            pathmodify.mod.dir('foo', __dirname + '/../target/commonui/assets/javascripts'),
        ]})
    .transform("babelify", {
        presets: ["es2015", "react"],
        plugins: ["transform-object-rest-spread"]
    });

Previously, the files were under the current directory and I could successfully load them by import Stuff from './stuff.jsx'

I moved them to support sharing with a related project, so now I need a complicated path to them.

When I run gulp browserify, I get this output.

looking for main.jsx in  app/assets/javascripts which is /Users/tda0106/projects/project/dev/components/ui/ca/web/ui/app/assets/javascripts
[12:42:55] Using gulpfile ~/projects/project/dev/components/ui/ca/web/ui/gulpfile.js
(node:32497) DeprecationWarning: Deprecated: pathmodify: Don't call the export as a factory. The export is now the plugin function.
[12:42:55] Starting 'browserify'...
[12:42:55] Finished 'browserify' after 1.88 ms
Error runing browserify Unknown plugin "transform-object-rest-spread" specified in "base" at 0, attempted to resolve relative to "/Users/tda0106/projects/project/dev/components/ui/ca/web/target/commonui/assets/javascripts/utils" while parsing file: /Users/tda0106/projects/project/dev/components/ui/ca/web/target/commonui/assets/javascripts/utils/FetchUtils.jsx undefined

If I remove the paths from browserify, I get the same result. (That is left over from attempting to use remapify.)

If I remove the plugins line, I get an error that the plugin would fix, and an error that it cannot resolve the es2015 preset referencing the same directory as above.

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