mirror of
https://github.com/cupcakearmy/fight-of-the-mobiles.git
synced 2024-11-04 22:44:15 +01:00
config
This commit is contained in:
parent
786d05116f
commit
717e145b00
70
src/cordova/webpack.config.js
Executable file
70
src/cordova/webpack.config.js
Executable file
@ -0,0 +1,70 @@
|
||||
const path = require('path')
|
||||
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
|
||||
module.exports = {
|
||||
entry: [
|
||||
'./index.jsx'
|
||||
],
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'public')
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx']
|
||||
},
|
||||
context: path.resolve(__dirname, 'src'),
|
||||
devServer: {
|
||||
contentBase: path.resolve(__dirname, 'public/assets'),
|
||||
open: true,
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.html'
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: 'bundle.css'
|
||||
})
|
||||
],
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.jsx?$/,
|
||||
include: /src/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-react', '@babel/preset-env']
|
||||
}
|
||||
}
|
||||
}, {
|
||||
test: /\.html$/,
|
||||
use: ['html-loader']
|
||||
}, {
|
||||
test: /\.css$/,
|
||||
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
||||
}, {
|
||||
test: /\.less$/,
|
||||
use: [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader']
|
||||
}, {
|
||||
test: /\.(jpg|png|gif|svg)$/,
|
||||
use: [{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: './assets/',
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
test: /\.(ttf|eot|woff|woff2|otf)$/,
|
||||
use: [{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: './assets/',
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user