Skip to content

Commit

Permalink
add css
Browse files Browse the repository at this point in the history
  • Loading branch information
allanchau committed Jun 1, 2021
1 parent f41c2bf commit 4af1442
Show file tree
Hide file tree
Showing 5 changed files with 963 additions and 2,307 deletions.
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
"build": "webpack"
},
"devDependencies": {
"date-fns": "^2.0.0-alpha.16",
"webpack": "^4.19.0",
"webpack-cli": "^3.1.0"
"autoprefixer": "^10.2.6",
"postcss": "^8.3.0",
"postcss-loader": "^5.3.0",
"sass": "^1.34.0",
"sass-loader": "^11.1.1",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0"
}
}
3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [["postcss-preset-env"], require("autoprefixer")],
};
Empty file added styles.scss
Empty file.
29 changes: 19 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
'use strict';
"use strict";

const path = require('path');
const path = require("path");

module.exports = {
entry: {
bundle: path.join(__dirname, 'index.js'),
},
mode: 'production',
output: {
filename: '[name].[hash].js',
path: path.join(__dirname, 'dist'),
},
entry: {
main: path.join(__dirname, "index.js"),
styles: path.join(__dirname, "styles.scss"),
},
mode: "production",
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: ["style-loader", "css-loader", "postcss-loader", "sass-loader"],
},
],
},
output: {
filename: "[name].[hash].js",
path: path.join(__dirname, "dist"),
},
};
Loading

0 comments on commit 4af1442

Please sign in to comment.