Commit c09e3bc8 authored by 张俊's avatar 张俊

Initial commit

parents
node_modules
css
\ No newline at end of file
{
"name": "scss-to-css",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack --mode development",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"css-loader": "^5.2.6",
"mini-css-extract-plugin": "^1.6.0",
"node-sass": "^6.0.0",
"sass-loader": "^11.1.1",
"style-loader": "^2.0.0",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0"
},
"author": "",
"license": "ISC",
"dependencies": {
"webpack-fix-style-only-entries": "^0.6.1",
"webpack-glob-entry": "^2.1.1"
}
}
.aa{
height: 100px;
background-color: #fff;
}
\ No newline at end of file
.aa{
width: 100px;
.bb{
height: 100px;
}
}
\ No newline at end of file
.cc{
margin: 0;
.dd{
padding: 0;
}
}
\ No newline at end of file
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const entry = require('webpack-glob-entry')
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
const baseConfig = {
module : {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
]
}
]
},
output: {
path: path.resolve(__dirname, './'),
},
}
module.exports = [
{
...baseConfig,
entry: entry('./src/*.scss'),
plugins: [
new FixStyleOnlyEntriesPlugin(),
new MiniCssExtractPlugin({
filename: 'css/[name].css' //css打包输出出口及文件名称
})
],
}
];
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment