mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
56 lines
1.1 KiB
JavaScript
56 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const path = require('path');
|
|
const fromRoot = _ => path.resolve(__dirname, _);
|
|
|
|
module.exports = {
|
|
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
|
entry: fromRoot('index.js'),
|
|
output: {
|
|
path: fromRoot('dist'),
|
|
filename: 'bundle.web.js',
|
|
},
|
|
devServer: {
|
|
static: {directory: fromRoot('dist')},
|
|
devMiddleware: {publicPath: '/'},
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(jsx?|tsx?)$/,
|
|
use: {loader: 'babel-loader'},
|
|
include: [
|
|
fromRoot('index.js'),
|
|
fromRoot('src'),
|
|
fromRoot('node_modules/react-native-svg'),
|
|
],
|
|
},
|
|
{
|
|
test: /\.(gif|jpe?g|png)$/i,
|
|
use: [
|
|
{
|
|
loader: 'file-loader',
|
|
options: {esModule: false},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
symlinks: false,
|
|
alias: {
|
|
'react-native$': 'react-native-web',
|
|
},
|
|
extensions: [
|
|
'.web.ts',
|
|
'.ts',
|
|
'.web.tsx',
|
|
'.tsx',
|
|
'.web.js',
|
|
'.js',
|
|
'.web.jsx',
|
|
'.jsx',
|
|
],
|
|
},
|
|
};
|