mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2025-01-05 19:53:55 +03:00
Add missing CSS loaders for todomvc app (#3535)
* Add missing CSS loaders for todomvc app Currently webpack does not bundle the index.css file located in the root directory. This PR adds the corresponding plugins and loaders to ensure the file is correctly bundled. Fixes #3443 * Fixed failing CI build Bumped version of `css-loader` as we're on webpack 5 already. Signed-off-by: Oliver T <geronimooliver00@gmail.com> --------- Signed-off-by: Oliver T <geronimooliver00@gmail.com>
This commit is contained in:
parent
eb36f9d752
commit
486238b524
@ -5,7 +5,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@wasm-tool/wasm-pack-plugin": "1.5.0",
|
||||
"css-loader": "^6.8.1",
|
||||
"html-webpack-plugin": "^5.3.2",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"text-encoding": "^0.7.0",
|
||||
"webpack": "^5.49.0",
|
||||
"webpack-cli": "^4.7.2",
|
||||
|
@ -3,7 +3,6 @@
|
||||
<head>
|
||||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
|
||||
<title>web-sys Wasm • TodoMVC</title>
|
||||
<link rel="stylesheet" href="./index.css">
|
||||
</head>
|
||||
<body>
|
||||
<section class="todoapp">
|
||||
|
@ -1,6 +1,7 @@
|
||||
// For more comments about what's going on here, check out the `hello_world`
|
||||
// example
|
||||
const rust = import('./pkg');
|
||||
const css = import('./index.css');
|
||||
|
||||
rust
|
||||
.then(m => m.run())
|
||||
|
@ -5,7 +5,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@wasm-tool/wasm-pack-plugin": "1.5.0",
|
||||
"css-loader": "^6.8.1",
|
||||
"html-webpack-plugin": "^5.3.2",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"text-encoding": "^0.7.0",
|
||||
"webpack": "^5.49.0",
|
||||
"webpack-cli": "^4.7.2",
|
||||
|
@ -2,6 +2,7 @@ const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
module.exports = {
|
||||
entry: './index.js',
|
||||
@ -13,6 +14,7 @@ module.exports = {
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.html'
|
||||
}),
|
||||
new MiniCssExtractPlugin(),
|
||||
new WasmPackPlugin({
|
||||
crateDirectory: path.resolve(__dirname, ".")
|
||||
}),
|
||||
@ -26,5 +28,13 @@ module.exports = {
|
||||
mode: 'development',
|
||||
experiments: {
|
||||
asyncWebAssembly: true
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [MiniCssExtractPlugin.loader, 'css-loader'],
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user