Deploy Heroku application node js - node.js

;) I created my portfolio with NodeJs and VueJS , it works perfectly in local and I would like to deploy my website in online with heroku. But i follow instructions and finally I have the message " application error ".
I don't understand !
So this is my code :
index.js in folder config
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}
package.json :
{
"name": "app",
"version": "1.0.0",
"description": "Portfolio",
"author": "Alex Salicki <salicki.alex#gmail.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"ev-emitter": "^1.1.1",
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"gsap": "^1.20.4",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"scrollmagic": "^2.0.5",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
I add too the file " procfile " with the code : " web : node index.js " for heroku application
You can see my complete code in GitHub : https://github.com/Alexsalicki91/website/tree/master/portfolio-1/spa
Can you help me ? Where is my errors ?
Have a nice days guys !
Alex Salicki

Related

failed to load config from vite.config.js ( RangeError: Maximum call stack size exceeded )

trying to run a project locally . i can not understand why gives me this error
even after i update npm and node but still gives me error
failed to load config from C:\Users\atii\Desktop\project\myapp( $$ Backend ++ Front End )\myapp\client\vite.config.js
[1] error when starting dev server:
[1] RangeError: Maximum call stack size exceeded
here is my vite.config.js
import react from '#vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
import macrosPlugin from 'vite-plugin-babel-macros';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [react(), macrosPlugin()],
root: './',
build: {
outDir: 'dist',
},
publicDir: 'src',
server: {
fs: {
allow: ['..'],
},
},
define: {
'process.env': env,
},
};
});
this is my package.json file :
{
"name": "myapp",
"version": "1.0.0",
"author": "samurai",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "npm run build && vite preview"
},
"dependencies": {
"#fvilers/disable-react-devtools": "^1.3.0",
"#reduxjs/toolkit": "^1.8.2",
"autosize": "^5.0.1",
"easymde": "^2.16.1",
"framer-motion": "^6.3.11",
"gapi-script": "^1.2.0",
"import": "0.0.6",
"moment": "^2.29.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dotenv": "^0.1.3",
"react-facebook-login": "^4.1.1",
"react-github-login-button": "^1.0.1",
"react-google-button": "^0.7.2",
"react-google-login": "^5.2.2",
"react-icons": "^4.4.0",
"react-login-github": "^1.0.8",
"react-markdown": "^8.0.3",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"react-simplemde-editor": "^5.0.2",
"react-spinners": "^0.13.3",
"react-syntax-highlighter": "^15.5.0",
"react-toastify": "^9.0.8",
"redux-persist": "^6.0.0",
"remark-breaks": "^3.0.2",
"socket.io-client": "^4.5.1",
"styled-components": "^5.3.5",
"tailwindcss": "^3.1.3"
},
"devDependencies": {
"#types/react": "^18.0.14",
"#types/react-dom": "^18.0.5",
"#vitejs/plugin-react": "^1.3.2",
"autoprefixer": "^10.4.7",
"postcss": "^8.4.14",
"twin.macro": "^2.8.2",
"vite": "^2.9.15",
"vite-plugin-babel-macros": "^1.0.6"
},
"babelMacros": {
"twin": {
"config": "./tailwind.config.js",
"preset": "styled-components"
}
}
}
and this is my .env file
BASE_URL=
GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
i did update node and npm but it did not worked for me .
when i delete .env file it is working . but with .env file not working . the problem is .env file

React + Webpack + Material UI styling breaking in production

I am trying to create a reusable React component with Material UI and npm link it to a different application. The component and application are being bundled using webpack. The application renders the component fine in development, but when I bundle the application the component starts breaking the material-ui styling.
Some of the solutions I have tried include:
https://material-ui.com/getting-started/faq/#why-arent-my-components-rendering-correctly-in-production-builds
https://reactjs.org/warnings/invalid-hook-call-warning.html
I thought defining #material/core in the peerDependencies would solve it, but every time I use a Material-UI component the application throws the Invalid Hook Call Warning.
Nothing seems to work ☹️
component's package.json:
{
"name": "component",
"version": "1.0.0",
"description": "",
"main": "build/index.js",
"scripts": {
"test": "jest",
"start": "webpack --watch",
"build": "webpack --optimize-minimize -p",
"dist": "npm run build"
},
"peerDependencies": {
"#material-ui/core": "^3.2.0 || ^4.0.0",
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},
"devDependencies": {
"#babel/core": "^7.2.2",
"#babel/plugin-proposal-class-properties": "^7.5.0",
"#babel/preset-env": "^7.5.4",
"#babel/preset-react": "^7.0.0",
"#material-ui/core": "^4.9.0",
"#material-ui/icons": "^3.0.2",
"babel-cli": "^6.26.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^7.2.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.5",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-runtime": "^6.26.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.7.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.1.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.7.0",
"faker": "^4.1.0",
"husky": "^1.3.1",
"jest": "^23.6.0",
"jest-styled-components": "^6.3.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"sinon": "^7.2.2",
"webpack": "^4.39.2",
"webpack-cli": "^3.3.7"
},
"dependencies": {
"clsx": "^1.0.4",
"prop-types": "^15.6.2"
}
}
component's webpack.config.js
const path = require('path');
module.exports = {
entry: './src/index.jsx',
mode: 'production',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'index.js',
libraryTarget: 'commonjs2',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
include: path.resolve(__dirname, 'src'),
exclude: /(node_modules|bower_components|build)/,
use: {
loader: 'babel-loader',
options: {
presets: ['#babel/env'],
},
},
},
],
},
resolve: { extensions: ['*', '.js', '.jsx'] },
externals: {
react: 'react',
},
optimization: {
minimize: true,
},
};
Any help would be much appreciated! Thanks in advance.
This actually makes perfect sense if you check out the docs on npm link:
First, npm link in a package folder will create a symlink in the global folder {prefix}/lib/node_modules/ that links to the package where the npm link command was executed.
Note that the command only makes a symlink locally so when you build/deploy, it would logically follow the package can't be found.
My advice would be to create a scoped package for your custom component. Create an npm account, upload your package and then add it to your project like this:
npm install #brettoberg/reusable-component
Now, webpack and any other system should be able to find it because it's published.

Deployment Issue: React application not rendering properly on github pages

I have created a react redux front end app. The app is working perfectly fine using node CLI and accessible using localhost:3050 or localhost:8080. However, if I try to run production build using github pages the page only renders partially. The same is observed if I open the production index.html file directly in the browser. I have searched for hours but not able to find the any clue. Here is the github repo and the public url of the project. Any help would be deeply appreciated.
Here is some of the configuration and package files
package.json
{
"name": "items-random-rater",
"version": "0.1.0",
"private": true,
"author": "Muhammed Salman Shamsi",
"dependencies": {
"axios": "^0.19.0",
"babel-polyfill": "^6.26.0",
"bootstrap": "^4.3.1",
"lodash": "^4.17.15",
"nodemon": "^1.19.1",
"popper.js": "^1.15.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-redux": "^7.1.1",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "nodemon server.js",
"test": "mocha --require babel-polyfill --require babel-core/register --require ./test/withDom.js --require ./test/test_helper.js --recursive ./test",
"test:watch": "npm run test -- --watch",
"clean": "rimraf public",
"build": "NODE_ENV=production npm run clean && webpack -p",
"serve": "webpack-dev-server",
"deploy": "npm run build && gh-pages -d public"
},
"devDependencies": {
"#fortawesome/fontawesome-free": "^5.10.2",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"chai": "^4.2.0",
"chai-jquery": "^2.1.0",
"css-loader": "^1.0.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^5.13.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"express": "^4.17.1",
"gh-pages": "^2.1.1",
"html-webpack-plugin": "^3.2.0",
"jquery": "^3.4.1",
"jsdom": "^15.1.1",
"mini-css-extract-plugin": "^0.4.1",
"mocha": "^6.2.0",
"node-sass": "^4.9.2",
"postcss-loader": "^2.1.6",
"redux-mock-store": "^1.5.3",
"rimraf": "^2.7.1",
"sass-loader": "^7.1.0",
"webpack": "^4.39.3",
"webpack-cli": "^3.3.7",
"webpack-dev-middleware": "^3.7.0",
"webpack-dev-server": "^3.8.0"
}
}
webpack.config.json
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const env = process.env.NODE_ENV;
const VENDOR_LIBS = [
"lodash","react","react-dom","react-redux",
"redux","axios"
];
module.exports = {
mode: env || 'development',
entry: {
bundle: ['babel-polyfill','./src/index.js'],
vendor: VENDOR_LIBS
},
output: {
path: path.join(__dirname, 'public'),
filename: '[name].[chunkhash].js'
},
module: {
rules: [
{
use: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/
},
{
use: ['style-loader', 'css-loader'],
test: /\.css$/
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['env','react','stage-2']
}
}
]
},
{
test: /\.scss$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
'css-loader',
'postcss-loader',
'sass-loader'
]
},
{
test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/,
loader: 'url-loader?limit=100000'
}
]
},
devtool: 'inline-source-map',
devServer: {
contentBase: path.join(__dirname, 'public'),
publicPath: '/public/',
compress: true,
port: 8080
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html'
}),
new MiniCssExtractPlugin({
filename: 'style.[contenthash].css'
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
]
};

Error: Can't resolve babel-loader... What is wrong with my webpack.config code?

Banging my head against the wall for the past few hours trying to figure out what happened to my webpack.config. I even tried to revert to an older commit and still saw the same problems. Any ideas or suggestions would be much appreciated. Thanks! Posting my webpack.config and package.json below
webpack.config
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: [ '#babel/polyfill', './app/index.js',],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index_bundle.js',
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader'},
{ test: /\.css$/, use: [ 'style-loader', 'css-loader']},
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'app/index.html'
})
],
mode: process.env.NODE_ENV === 'production' ? 'production': 'development'
};
----------
## package.json
{
"name": "my-reps",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server",
"build": "NODE_ENV='production' webpack",
"firebase-init": "firebase login && firebase init",
"deploy": "npm run build && firebase deploy"
},
"babel": {
"presets": [
"#babel/preset-env",
"#babel/preset-react"
],
"plugins": [
"#babel/plugin-proposal-class-properties"
]
},
"author": "",
"license": "ISC",
"dependencies": {
"#babel/polyfill": "^7.0.0",
"axios": "^0.18.0",
"bootstrap": "^4.1.3",
"classnames": "^2.2.6",
"firebase-tools": "^4.2.1",
"jquery": "^3.3.1",
"lodash.debounce": "^4.0.8",
"moment": "^2.22.2",
"prop-types": "^15.6.2",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-places-autocomplete": "^7.2.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-twitter-embed": "^1.1.3",
"react-twitter-widgets": "^1.7.1",
"reactstrap": "^6.5.0"
},
"devDependencies": {
"#babel/core": "^7.1.6",
"#babel/plugin-proposal-class-properties": "^7.1.0",
"#babel/plugin-transform-react-constant-elements": "^7.0.0",
"#babel/preset-env": "^7.1.6",
"#babel/preset-react": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.0",
"babel-register": "^6.26.0",
"css-loader": "^1.0.0",
"html-webpack-plugin": "^3.2.0",
"style-loader": "^0.22.1",
"webpack": "^4.16.5",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.5"
}
}
error message:
ERROR in ./node_modules/lodash/lodash.js
Module not found: Error: Can't resolve 'babel-loader' in '/Users/michaelberry/Desktop/my-reps'
# ./node_modules/lodash/lodash.js 1:0-41
# ./node_modules/html-webpack-plugin/lib/loader.js!./app/index.html
ERROR in ./node_modules/lodash/lodash.js
Module not found: Error: Can't resolve 'babel-loader' in '/Users/michaelberry/Desktop/my-reps'
# ./node_modules/lodash/lodash.js 1:0-41
# ./node_modules/html-webpack-plugin/lib/loader.js!./app/index.html
ℹ 「wdm」: Failed to compile.
Did you happened to update npm packages recently? Particularly the following packages in devDependencies:
webpack
webpack-cli
babel
babel-loader
Certain version of these packages may cause problems when building.
If so, you can try reinstalling devDependencies to the versions you used to use.
Another way is to use the latest version instead. Sometimes npm update command will not install the latest version for some reason. So you need to go to npm website and check the latest version of each devDependencies.

Update to Node 9 Results in Minification

I hope you could help me to figure this out. I have a project that uses Webpack and React. If I update Node from v. 6 to 9, the code gets minified. If I downgrade Node back to v. 6, everything as it is supposed to be. I was wondering why could it happen? As I understand, minification is something that should happen on demand. Does Node 9 enforce somehow minification?
Here are my package.json
{
"name": "tgc-ui",
"version": "1.0.0",
"description": "table-grid-ui",
"main": "index.js",
"scripts": {
"test": "mocha --compilers js:babel-core/register --require test/helpers/browser.js test/*/*.spec.js"
},
"repository": {
"type": "git",
"url": "ssh://git#stash.idalko.com:7999/ip/tgc-ui.git"
},
"keywords": [
"table",
"grid",
"ui"
],
"author": "idalko",
"license": "ISC",
"dependencies": {
"#atlaskit/banner": "^2.4.2",
"#atlaskit/button": "^5.4.8",
"#atlaskit/checkbox": "^1.0.0",
"#atlaskit/dynamic-table": "^7.2.0",
"#atlaskit/field-text": "^4.1.2",
"#atlaskit/flag": "^6.1.8",
"#atlaskit/icon": "^7.0.0",
"#atlaskit/inline-edit": "^4.5.6",
"#atlaskit/inline-message": "^3.0.4",
"#atlaskit/input": "^1.1.2",
"#atlaskit/lozenge": "^3.4.2",
"#atlaskit/modal-dialog": "^3.0.2",
"#atlaskit/multi-select": "^7.1.7",
"#atlaskit/single-select": "^3.0.0",
"#atlaskit/spinner": "^2.2.3",
"#atlaskit/tabs": "^2.0.0",
"#atlaskit/tooltip": "^6.0.0",
"axios": "^0.16.2",
"bootstrap": "^3.3.7",
"brace": "^0.11.0",
"browser-locale": "^1.0.3",
"moment": "^2.18.1",
"moxios": "^0.4.0",
"prop-types": "^15.5.10",
"react": "^15.5.4",
"react-ace": "^5.8.0",
"react-addons-update": "^15.6.0",
"react-autocomplete": "^1.7.2",
"react-autosize-textarea": "^0.4.9",
"react-autosuggest": "^9.3.2",
"react-bootstrap": "^0.31.0",
"react-copy-to-clipboard": "^5.0.1",
"react-data-grid": "^2.0.53",
"react-data-grid-addons": "^2.0.53",
"react-datepicker": "^0.53.0",
"react-datetime": "^2.10.1",
"react-dom": "^15.5.4",
"react-file-reader-input": "^1.1.4",
"react-keybinding-component": "^0.5.0",
"sortablejs": "^1.6.1",
"string-hash": "^1.1.3",
"styled-components": "^1.4.6",
"uuid": "^3.1.0",
"yarn": "^0.27.5"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.0.0",
"babel-plugin-react-require": "^3.0.0",
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "^6.24.1",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"chai": "^4.0.2",
"css-loader": "^0.28.4",
"enzyme": "^2.8.2",
"file-loader": "^0.11.2",
"jsdom": "^11.5.1",
"mocha": "^3.4.2",
"react": "^15.5.4",
"react-test-renderer": "^15.5.4",
"sinon": "^2.3.4",
"style-loader": "^0.18.2",
"uglify-js": "^3.0.23",
"uglifyjs-webpack-plugin": "^0.4.6",
"url-loader": "^0.5.9",
"webpack": "^2.6.1"
}
}
and webpack.config.js
const webpack = require("webpack");
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
var path = require('path'),
jsxPath = 'src',
jsPath = 'dist/lib',
srcPath = path.join(__dirname, jsxPath);
var isProd = (process.env.NODE_ENV === 'production');
var uiVersion = (process.env.CI_VERSION === '0.1.0-SNAPSHOT') ? '' : `_${process.env.CI_VERSION}`;
var service = {
jiracloud: './custom_modules/CloudUtilityService.jsx'
}[process.env.APP_ENV];
function getPlugins() {
var plugins = [];
plugins.push(new webpack.DefinePlugin({
'process.env': {
'CI_VERSION': JSON.stringify(process.env.CI_VERSION),
'NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'APP_ENV': JSON.stringify(process.env.APP_ENV)
}
}));
if (isProd) {
plugins.push(new UglifyJSPlugin({
compress: {
warnings: false,
screw_ie8: true,
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true,
evaluate: true,
if_return: true,
join_vars: true
},
output: {
comments: false
}
}));
}
return plugins;
}
module.exports = {
entry: {
errorLicense: [path.join(srcPath, 'license/ErrorLicense.jsx')],
ducketConfiguration: [path.join(srcPath, 'ducketconfig/DucketConfig.jsx')],
dataSourceConfiguration: [path.join(srcPath, 'datasource/DataSourcesPage.jsx')],
ducket: [path.join(srcPath, 'grid/Grid.jsx')],
serviceDesk: [path.join(srcPath, 'adjustment/servicedesk/ServiceDesk.jsx')],
searchHelp: [path.join(srcPath, 'search/SearchHelp.jsx')]
},
output: {
//path:path.resolve(__dirname, jsPath),
path:path.resolve(__dirname, "../tgc/public/javascript"),
filename: `[name]${uiVersion}.js`
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders:['babel-loader']
},
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif)(\?\S*)?$/,
loader: 'url-loader?limit=100000#name=[name][ext]'
}
]
},
resolve: {
alias: {
'styled-components': path.resolve('./node_modules/styled-components/dist/styled-components.es.js'),
'utility-service': path.resolve(service)
}
},
plugins: getPlugins()
};
Thank you in advance.
Iev--
Node does never enforce minification, this piece of code in your webpack configuration is:
if (isProd) {
plugins.push(new UglifyJSPlugin({
compress: {
warnings: false,
screw_ie8: true,
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true,
evaluate: true,
if_return: true,
join_vars: true
},
output: {
comments: false
}
}));
}
This probably wasn't working on an older version of node because your devDependencies are for uglify#3 which might require node.js > v6

Resources