Commit d140e4ff authored by shangbj's avatar shangbj

scss

parent 5fcbc5e9
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="app"></div>
<script src="./dist/bundle.js"></script>
</body>
</html>
\ No newline at end of file
require('./main.scss')
const show = require('./show')
show('scss')
\ No newline at end of file
$blue:#1876e7;
#app{
color:$blue
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "3-4",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack --mode production",
"dev": "webpack --mode development"
},
"author": "",
"license": "ISC",
"devDependencies": {
"css-loader": "^0.28.11",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.3",
"style-loader": "^0.21.0",
"webpack": "^4.12.0",
"webpack-cli": "^3.0.3"
}
}
function show(txt){
document.getElementById("app").innerText = 'Hello,' +txt;
}
module.exports = show;
\ No newline at end of file
const path = require('path');
module.exports = {
entry:'./main.js',
output:{
filename:'bundle.js',
path:path.resolve(__dirname,'./dist')
},
module:{
rules:[
{
test: /\.scss$/,
use: ['style-loader','css-loader','sass-loader']
}
]
}
}
\ 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