webpack打包css样式

安装依赖

npm install style-loader@2.0.0 css-loader@5.1.0 -D

配置loader

module.exports = {
	mode: 'production',
	entry: './src/index.js',
	module: {
		rules: [{
			test: /\.css$/,
			use: ['style-loader', 'css-loader']
		}]
	},
	// ......
};
评论
:broken_heart: :confounded: :flushed: :frowning: :grinning: :heart: :kissing_heart: :mask: :pensive: :rage: :relaxed: :scream: :smile: :smirk: :sob: :stuck_out_tongue_closed_eyes: :stuck_out_tongue_winking_eye: :wink: