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

[polymer-build] Rewriting ES6 imports not working programatically #3477

Open
TvrtkoM opened this issue Nov 24, 2019 · 2 comments
Open

[polymer-build] Rewriting ES6 imports not working programatically #3477

TvrtkoM opened this issue Nov 24, 2019 · 2 comments
Labels

Comments

@TvrtkoM
Copy link

TvrtkoM commented Nov 24, 2019

Hello, I need help :)

Polymer cli command polymer build works fine. but I'm trying to make a script (gulp) to do this:

const polymerProject = new polymerBuild.PolymerProject(polymerJson);
gulp.task('polymer-build', () => {
  const outDir = './build';
  return new Promise((resolve, reject) => {
    rimraf(outDir, () => {
      let buildStream = merge(polymerProject.sources(), polymerProject.dependencies());
      buildStream = buildStream.pipe(gulp.dest(outDir));
      resolve(waitFor(buildStream));
    });
  });
});

polymer json:

{
  "entrypoint": "./index.html",
  "npm": true,
  "moduleResolution": "node",
  "basePath": true,
  "autoBasePath": true,
  "sources": [
   "dist/**/*",
   "!dist/**/*.spec.js",
   "./node_modules/@polymer/*/**",
   "./node_modules/@develop/demo-snippet/*/**"
  ],
  "extraDependencies": [
    "./node_modules/numbro/dist/numbro.min.js",
    "./node_modules/@webcomponents/**/*",
    "./node_modules/web-animations-js/web-animations-next-lite.min.js",
    "./node_modules/@granite-elements/ace-widget/ace-widget.js",
    "./node_modules/@styles/common/*/**",
    "./node_modules/ace-builds/src-min-noconflict/mode-html.js",
    "./node_modules/ace-builds/src-min-noconflict/theme-dawn.js",
    "./node_modules/ace-builds/src-min-noconflict/worker-html.js",
    "./node_modules/ace-builds/src-noconflict/ace.js",
    "./node_modules/ace-builds/src-noconflict/ext-language_tools.js",
    "./node_modules/ace-builds/src-noconflict/snippets/snippets.js"
  ]
}

when i run gulp polymer-build .js files are left untouched. All imports are absolute and I need them rewritten to e.g ../../@polymer/polymer-element just like polymer-cli build command does.

Please help. It is urgent

@TvrtkoM
Copy link
Author

TvrtkoM commented Nov 24, 2019

it is a polymer 3 project

@stale
Copy link

stale bot commented Nov 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant