Initial commit
commit
05abaa2596
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
public
|
@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
const css = require("./test.css");
|
||||
|
||||
console.log("Hello world!");
|
||||
console.log(css);
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "icss-loader-test",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"defaults": "webpack-defaults"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@git.cryto.net:joepie91/icss-loader-test.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-loader": "^7.1.5",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"css-loader": "^1.0.0",
|
||||
"mini-css-extract-plugin": "^0.4.2",
|
||||
"webpack": "^4.17.1",
|
||||
"webpack-cli": "^3.1.0"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
.foo {
|
||||
background-color: yellow;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
:import("./shared.css") {
|
||||
fooAlias: foo;
|
||||
}
|
||||
|
||||
.primaryClass {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.primaryClass > .fooAlias {
|
||||
color: pink;
|
||||
}
|
||||
|
||||
.secondaryClass {
|
||||
composes: foo from "./shared.css";
|
||||
color: blue
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
|
||||
const webpack = require("webpack");
|
||||
const path = require("path");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
module.exports = {
|
||||
watch: true,
|
||||
mode: "development",
|
||||
entry: {
|
||||
main: "./index.jsx"
|
||||
},
|
||||
output: {
|
||||
publicPath: "/",
|
||||
path: path.join(__dirname, "public/"),
|
||||
filename: "bundle.js"
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
resolve: {
|
||||
extensions: [".js", ".jsx"]
|
||||
},
|
||||
use: [{
|
||||
loader: require.resolve("babel-loader"),
|
||||
query: {
|
||||
presets: [
|
||||
"es2015",
|
||||
"react"
|
||||
].map(item => require.resolve(`babel-preset-${item}`))
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
test: /\.css$/,
|
||||
use: [{
|
||||
loader: MiniCssExtractPlugin.loader
|
||||
}, {
|
||||
loader: require.resolve("css-loader"),
|
||||
options: {
|
||||
// modules: true,
|
||||
sourceMap: true,
|
||||
// localIdentName: "[name]__[local]--[hash:base64:8]"
|
||||
}
|
||||
}]
|
||||
}]
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].css",
|
||||
chunkFilename: "[id].css"
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoEmitOnErrorsPlugin()
|
||||
],
|
||||
devtool: "source-map"
|
||||
};
|
Loading…
Reference in New Issue