'NODE_ENV' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@1.0.0 build-prod: NODE_ENV=production webpack --config webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@1.0.0 build-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\NOTE\AppData\Roaming\npm-cache_logs\2020-11-26T22_43_15_531Z-debug.log
const path = require('path'); const babiliPlugin = require('babili-webpack-plugin'); const extractTextPlugin = require ('extract-text-webpack-plugin'); const optimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const webpack = require('webpack');
let plugins = [];
plugins.push(new extractTextPlugin('styles.css'))
plugins.push(new webpack.ProvidePlugin({ '$': 'jquery/dist/jquery.js', 'jQuery': 'jquery/dist/jquery.js' }));
plugins.push(new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.bundle.js'
}));
if(process.env.NODE__ENV == 'production') {
plugins.push(new babiliPl());
plugins.push(webpack.optimize.ModuleconcatenationPlugin());
plugins.push(new optimizeCSSAssetsPlugin({
cssProcessor: require('cssnano'),
cssProcessorOptions: {
discardComments: {
removeAll: true
}
},
canPrint: true
}));
}
module.exports = {
entry: {
app: './app-src/app.js',
vendor: ['jquery', 'bootstrap', 'reflect-metadata']
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: "dist"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test : /\.css$/,
use: extractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'
})
},
{
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file-loader'
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=image/svg+xml'
}
]
},
plugins
}