2

I'm trying Polymer 3, and i'm asking a question. Is it possible to try it (or to build a complete app) without using Polymer CLI?

After searching, I think that it's not really possible because of using package names in my imports.

As the documentation say : "Using package names in your imports makes it easier to install third-party dependencies, and removes the need to juggle the different path styles of elements and applications. Previously, for example, you had to import the Polymer library from ./node_modules/@polymer/polymer/polymer-element.js in apps, and from ../@polymer/polymer/polymer-element.js in reusable elements. Now, apps and reusable elements can both import from @polymer/polymer/polymer-element.js.

The Polymer CLI tools automatically resolve and rewrite imports that use package names to imports that use paths, producing web-compatible code for the browser."

Is there any solution to use Polymer 3 without Polymer CLI ?

thanks a lot

user3197506
  • 197
  • 1
  • 2
  • 14
  • As far as I know, it is not necessary, as Polymer 3 dependencies can install with npm. And you may serve localhost with other local host services something like 'firebase serve' ( I use always). here the link for more help : https://www.polymer-project.org/3.0/start/install-3-0 – Cappittall Nov 01 '18 at 16:34

5 Answers5

1

The Polymer PWA has a Webpack branch that does not use the CLI i think https://github.com/Polymer/pwa-starter-kit/tree/webpack

Swift
  • 166
  • 2
  • 16
1

Polymer 3 can indeed be developed without the Polymer CLI, however you do still need to transpile you application down to resolve imports. From what I understand, webpack is quite able to do this. In fact, webpack is a transpiler built into angular CLI so Polymer 3 can intergrate really nicely with Angular applications also.

If you're aiming at creating completely independent components like 'paper-element' I think you'd have to build each component seperately with webpack.

Worth noting is that, developing in typescript will become much easier one you figure out how to bundle your project with webpack.

bloo
  • 1,416
  • 2
  • 13
  • 19
1

You can use webpack. Here's a sample repo I made of LitElement with a basic webpack config with Babel and decorator support: https://github.com/JeremyBernier/lit-element-webpack-hello-world

Jeremy Bernier
  • 1,746
  • 1
  • 17
  • 17
0

you can. use the polymer-cli build the demo first, then use the code inside build/dev/ directly - but you need to manage everything manual after then...

mindon
  • 318
  • 4
  • 13
0

You can serve a Polymer app using any server technology you want.But you need Polymer CLI for develop. I'm using Apache Server for serve my Polymer Web Page.To do this, I just need to put the build file into Apache.

Check Polymer 3.0 Build for Production to know how it is done;

Yunus ER
  • 1,999
  • 2
  • 9
  • 14
  • While this link may answer the question, it's always better to include the [essential parts of the answer](https://meta.stackexchange.com/a/8259) here and provide the link for reference. Link-only answers can become invalid if the linked page changes. Answers that are little more than a link [may be deleted](https://stackoverflow.com/help/deleted-answers). – Joey May 03 '19 at 09:33