mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-28 05:52:21 +03:00
Add #[wasm_bindgen(start)], plugins to webpack config, Update deps
This commit is contained in:
parent
89e245bddf
commit
caac2eba53
5
examples/todomvc/.gitignore
vendored
5
examples/todomvc/.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
target/
|
||||
todomvc.js
|
||||
dist/
|
||||
_site/
|
||||
|
||||
todomvc*
|
||||
*.swp
|
||||
|
@ -13,10 +13,10 @@ askama = "0.7.2"
|
||||
js-sys = "0.3.5"
|
||||
wasm-bindgen = "0.2.28"
|
||||
askama = "0.7.2"
|
||||
console_error_panic_hook = "0.1"
|
||||
console_error_panic_hook = "0.1.5"
|
||||
|
||||
[dependencies.web-sys]
|
||||
version = "0.3.4"
|
||||
version = "0.3.5"
|
||||
features = [
|
||||
'console',
|
||||
'CssStyleDeclaration',
|
||||
|
@ -37,7 +37,6 @@
|
||||
<p>Written by <a href="http://twitter.com/KingstonTime/">Jonathan Kingston</a></p>
|
||||
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
|
||||
</footer>
|
||||
<link rel="stylesheet" href="./base.css">
|
||||
<script src='./index.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -63,7 +63,7 @@ fn app(name: &str) {
|
||||
}
|
||||
|
||||
/// Entry point into the program from JavaScript
|
||||
#[wasm_bindgen]
|
||||
#[wasm_bindgen(start)]
|
||||
pub fn run() {
|
||||
console_error_panic_hook::set_once();
|
||||
app("todos-wasmbindgen");
|
||||
|
@ -1,4 +1,6 @@
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
entry: './index.js',
|
||||
@ -6,5 +8,16 @@ module.exports = {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: 'index.js',
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: "index.html"
|
||||
}),
|
||||
// Have this example work in Edge which doesn't ship `TextEncoder` or
|
||||
// `TextDecoder` at this time.
|
||||
new webpack.ProvidePlugin({
|
||||
TextDecoder: ['text-encoding', 'TextDecoder'],
|
||||
TextEncoder: ['text-encoding', 'TextEncoder']
|
||||
})
|
||||
],
|
||||
mode: 'development'
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user