Commit a054a73b authored by Muhammadali's avatar Muhammadali

update-

parent e455d1bd
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.5.6", "version": "4.5.7",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
"dev": "webpack serve --mode=development", "dev": "webpack serve --mode=development",
"build": "webpack", "build:dev": "webpack --env=development --watch ",
"start": "webpack --watch" "build:prod": "webpack --env=production"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
......
...@@ -3,50 +3,57 @@ ...@@ -3,50 +3,57 @@
const path = require('path'); const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = { //env.production
entry: path.join(__dirname, 'src', 'index.js'),
mode: 'development', module.exports = (env) => {
output: { console.log('TYPE: ', env?.production ? 'production' : 'development');
path: path.resolve(__dirname, 'dist'), return {
}, entry: path.join(__dirname, 'src', 'index.js'),
// devServer: { mode: 'development',
// port: 80, output: {
// }, path: env?.production
module: { ? path.resolve(__dirname, 'prod')
rules: [ : path.resolve(__dirname, 'dist'),
{ },
test: /\.(jsx|js)$/, // devServer: {
use: { // port: 80,
loader: 'babel-loader', // },
options: { module: {
presets: [['@babel/env', { loose: true }], '@babel/preset-react'], rules: [
{
test: /\.(jsx|js)$/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/env', { loose: true }], '@babel/preset-react'],
},
}, },
}, },
}, {
{ test: /\.css$/i,
test: /\.css$/i, use: ['style-loader', 'css-loader', 'postcss-loader'],
use: ['style-loader', 'css-loader', 'postcss-loader'], },
}, {
{ test: /\.(png|jp(e*)g|svg|gif)$/,
test: /\.(png|jp(e*)g|svg|gif)$/, use: ['file-loader'],
use: ['file-loader'], },
}, {
{ test: /\.svg$/,
test: /\.svg$/, use: ['@svgr/webpack'],
use: ['@svgr/webpack'], },
}, {
{ test: /\.(mp3|wav)$/i,
test: /\.(mp3|wav)$/i, loader: 'file-loader',
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