const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules:[
// css加載
//包下載命令:npm install --save-dev style-loader css-loader
{
test:/\.css$/,
use:[
'style-loader',
'css-loader',
]
},
// 圖片加載及字體加載
//包下載命令:npm install --save-dev file-loader
{
test:/\.(png|jpg|gif)$/,
use:[
'file-loader'
]
},
{
test:/\.(woff|woff2|eot|ttf|otf)$/,
use:[
'file-loader'
]
},
// 資料加載 (json是內置的,所以無需下載對應的包)
//包命令:npm install --save-dev csv-loader xml-loader
{
test:/\.xml$/,
use:[
'xml-loader'
]
},
{
test:/\.(csv|tsv)$/,
use:[
'csv-loader'
]
}
]
}
};
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/177543.html
標籤:JavaScript
