mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-30 22:25:35 +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/
|
target/
|
||||||
todomvc.js
|
dist/
|
||||||
|
_site/
|
||||||
|
|
||||||
|
todomvc*
|
||||||
*.swp
|
*.swp
|
||||||
|
@ -13,10 +13,10 @@ askama = "0.7.2"
|
|||||||
js-sys = "0.3.5"
|
js-sys = "0.3.5"
|
||||||
wasm-bindgen = "0.2.28"
|
wasm-bindgen = "0.2.28"
|
||||||
askama = "0.7.2"
|
askama = "0.7.2"
|
||||||
console_error_panic_hook = "0.1"
|
console_error_panic_hook = "0.1.5"
|
||||||
|
|
||||||
[dependencies.web-sys]
|
[dependencies.web-sys]
|
||||||
version = "0.3.4"
|
version = "0.3.5"
|
||||||
features = [
|
features = [
|
||||||
'console',
|
'console',
|
||||||
'CssStyleDeclaration',
|
'CssStyleDeclaration',
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
<p>Written by <a href="http://twitter.com/KingstonTime/">Jonathan Kingston</a></p>
|
<p>Written by <a href="http://twitter.com/KingstonTime/">Jonathan Kingston</a></p>
|
||||||
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
|
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
<link rel="stylesheet" href="./base.css">
|
|
||||||
<script src='./index.js'></script>
|
<script src='./index.js'></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -63,7 +63,7 @@ fn app(name: &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Entry point into the program from JavaScript
|
/// Entry point into the program from JavaScript
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen(start)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
console_error_panic_hook::set_once();
|
console_error_panic_hook::set_once();
|
||||||
app("todos-wasmbindgen");
|
app("todos-wasmbindgen");
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './index.js',
|
entry: './index.js',
|
||||||
@ -6,5 +8,16 @@ module.exports = {
|
|||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'index.js',
|
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'
|
mode: 'development'
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user