68 строки
1.8 KiB
JavaScript
68 строки
1.8 KiB
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: './src/index.js',
|
|
output: {
|
|
filename: './dist/bundle.js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.jsx?$/,
|
|
exclude: /node_modules\/(?!(react-native-elements|react-native-vector-icons)\/).*/,
|
|
use: {
|
|
loader: 'babel-loader'
|
|
}
|
|
},
|
|
{
|
|
test: /\.(png|jpg|gif)$/,
|
|
use: [
|
|
{
|
|
loader: 'file-loader',
|
|
options: {}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader']
|
|
},
|
|
{
|
|
test: /\.svg$/,
|
|
use: [
|
|
{
|
|
loader: "babel-loader"
|
|
},
|
|
{
|
|
loader: "react-svg-loader",
|
|
options: {
|
|
jsx: true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
test: /\.jsx?$/,
|
|
enforce: 'pre',
|
|
use: [{
|
|
loader: 'eslint-loader',
|
|
options: { fix: true }
|
|
}],
|
|
include: path.resolve(__dirname, './src/**/*.js'),
|
|
exclude: ['/node_modules/', '/src/actions/']
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './public/index.html'
|
|
}), new MonacoWebpackPlugin()
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'react-native$': 'react-native-web'
|
|
}
|
|
}
|
|
}; |