[WEBPACK] 4. Webpack : CSS Loader (nghiepuit)
https://www.youtube.com/watch?v=yTc4Mk5cZF8&list=PLJ5qtRQovuEOqsMokakP9ue-y_jXhmCwJ&index=4
Ví dụ 1: css in js
var path = require('path');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: 'babel-loader',
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
}
};
Ví dụ 2: Tách file css
Previous[WEBPACK] 3. Webpack : Apply Babel Cho Project (nghiepuit)Nextplugin @babel/plugin-proposal-class-properties
Last updated