Commit a054a73b authored by Muhammadali's avatar Muhammadali

update-

parent e455d1bd
{
"name": "boxdialer",
"version": "4.5.6",
"version": "4.5.7",
"description": "",
"main": "src/boxDialer.js",
"scripts": {
"dev": "webpack serve --mode=development",
"build": "webpack",
"start": "webpack --watch"
"build:dev": "webpack --env=development --watch ",
"build:prod": "webpack --env=production"
},
"keywords": [],
"author": "",
......
......@@ -3,50 +3,57 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: path.join(__dirname, 'src', 'index.js'),
mode: 'development',
output: {
path: path.resolve(__dirname, 'dist'),
},
// devServer: {
// port: 80,
// },
module: {
rules: [
{
test: /\.(jsx|js)$/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/env', { loose: true }], '@babel/preset-react'],
//env.production
module.exports = (env) => {
console.log('TYPE: ', env?.production ? 'production' : 'development');
return {
entry: path.join(__dirname, 'src', 'index.js'),
mode: 'development',
output: {
path: env?.production
? path.resolve(__dirname, 'prod')
: path.resolve(__dirname, 'dist'),
},
// devServer: {
// port: 80,
// },
module: {
rules: [
{
test: /\.(jsx|js)$/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/env', { loose: true }], '@babel/preset-react'],
},
},
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader', 'postcss-loader'],
},
{
test: /\.(png|jp(e*)g|svg|gif)$/,
use: ['file-loader'],
},
{
test: /\.svg$/,
use: ['@svgr/webpack'],
},
{
test: /\.(mp3|wav)$/i,
loader: 'file-loader',
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader', 'postcss-loader'],
},
{
test: /\.(png|jp(e*)g|svg|gif)$/,
use: ['file-loader'],
},
{
test: /\.svg$/,
use: ['@svgr/webpack'],
},
{
test: /\.(mp3|wav)$/i,
loader: 'file-loader',
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src', 'index.html'),
}),
],
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src', 'index.html'),
}),
],
};
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment