Last active
August 13, 2017 12:13
-
-
Save ChadKillingsworth/28064061de74f13853a6c5c890be996a to your computer and use it in GitHub Desktop.
polymer-webpack-loader create new files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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