ojisan-toybox / without-css-loader

style-loader だけを使う

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

without-css-loader

style-loader だけを使う

npm i

npx webpack-dev-server

# or

npx webpack

without css-loader

it works...

const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");

module.exports = {
  mode: process.env.NODE_ENV,
  entry: "./src/index.tsx",
  output: {
    path: path.resolve(__dirname, "./dist"),
    filename: "build.js",
  },
  module: {
    rules: [
      {
        test: /\.(tsx|ts|js)$/,
        use: [
          {
            loader: "ts-loader",
          },
        ],
        exclude: /node_modules/,
      },
      {
        test: /\.css$/i,
        use: ["style-loader", "raw-loader"],
      },
    ],
  },
  resolve: {
    extensions: [".ts", ".tsx", ".js", ".jsx"],
  },
  plugins: [new HtmlWebpackPlugin({ template: "./src/index.html" })],
};

About

style-loader だけを使う


Languages

Language:JavaScript 62.6%Language:TypeScript 19.7%Language:HTML 14.8%Language:CSS 2.8%