Skip to content

Instantly share code, notes, and snippets.

@ChadKillingsworth
Last active August 13, 2017 12:13
Show Gist options
  • Save ChadKillingsworth/28064061de74f13853a6c5c890be996a to your computer and use it in GitHub Desktop.
Save ChadKillingsworth/28064061de74f13853a6c5c890be996a to your computer and use it in GitHub Desktop.
polymer-webpack-loader create new files
<!-- before loader -->
<link rel="import" href="other-element.html">
<dom-module id="original-element">
<template>Hello World</template>
<script>
class OriginalElement extends Polymer.Element {
static get is() { return 'original-element'; }
}
customElements.define(OriginalElement.is, OriginalElement);
</script>
</dom-module>
// After polymer-webpack-loader
import './other-element.html';
const RegisterHtmlTemplate = require('polymer-webpack-loader/register-html-template');
RegisterHtmlTemplate.register(require('./original-element.template.html'));
class OriginalElement extends Polymer.Element {
static get is() { return 'original-element'; }
}
customElements.define(OriginalElement.is, OriginalElement);
<!-- file created by polymer-webpack-loader - ready for html-loader -->
<dom-module id="original-element">
<template>Hello World</template>
</dom-module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment