-
-
Save timwis/e540d89aee77421f502b51bbd1ca1421 to your computer and use it in GitHub Desktop.
attempting to get skate.js to work with webpack
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<hello-world></hello-world> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
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
import { props, withComponent } from 'skatejs' | |
import withLitHtml from '@skatejs/renderer-lit-html' | |
import { html } from 'lit-html' | |
export default class HelloWorld extends withComponent(withLitHtml()) { | |
render () { | |
return html`<div>Hello, world!</div>` | |
} | |
} | |
customElements.define('hello-world', HelloWorld) |
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
{ | |
"name": "vizwit", | |
"version": "2.0.0-alpha", | |
"description": "", | |
"main": "src/index.js", | |
"scripts": { | |
"start": "webpack-dev-server --mode development" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "git+https://github.com/timwis/vizwit.git" | |
}, | |
"author": "timwis <tim@timwis.com>", | |
"license": "MIT", | |
"bugs": { | |
"url": "https://github.com/timwis/vizwit/issues" | |
}, | |
"homepage": "https://github.com/timwis/vizwit#readme", | |
"devDependencies": { | |
"html-webpack-plugin": "^3.2.0", | |
"webpack": "^4.8.1", | |
"webpack-cli": "^2.1.3", | |
"webpack-dev-server": "^3.1.4" | |
}, | |
"dependencies": { | |
"@skatejs/renderer-lit-html": "^0.2.0", | |
"lit-html": "^0.10.0", | |
"skatejs": "^5.1.2" | |
} | |
} |
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
const path = require('path') | |
module.exports = { | |
entry: './src/index.js', | |
devtool: 'inline-source-map', | |
devServer: { | |
contentBase: './dist' | |
}, | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'dist') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment