I would like to keep my polymer components nicely encapsulated but right now if I try to import any external modules into the components I get an undefined error for 'import'.
I use Webpack to bundle up my app but this packs up my javascript files only.
Is there a way to do keep my Polymer component encapsulated into a single html file or I must separate the js part when it comes to imports?
Example:
<link rel="import" href="../bower_components/polymer/polymer.html">
<dom-module id="my-new-view">
<template>
<style>
</style>
<h1>New view</h1>
</template>
<script>
import { myConstant } from '../module.js'; //<---- this throws error for the import'
Polymer({
is: 'my-new-view'
});
</script>
</dom-module>