我搜索过它,找不到任何与此问题相关的内容.
我想要这个的原因是工作流问题.我在chrome canary上设置了一个开发者帐户,并希望将与开发相关的所有内容保存到该浏览器中.
在devServer选项对象中,我可以告诉webpack-dev-server打开"Google Chrome Canary".我使用Mac,如果这有所作为.
我已经设置了我在 index.js 中导入的 global.css 文件
--root {
--main-color: red;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
Run Code Online (Sandbox Code Playgroud)
索引.js
import "./global.css";
import App from "./App.svelte";
const app = new App({
target: document.body
});
Run Code Online (Sandbox Code Playgroud)
我的 webpack 设置
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: "./src/index.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist")
},
module: {
rules: [
{
test: /\.(html|svelte)$/,
exclude: /node_modules/,
use: {
loader: "svelte-loader",
options: {
emitCss: true,
hotReload: …Run Code Online (Sandbox Code Playgroud)