Update development environment (Webpack)
This commit is contained in:
parent
6b95652a76
commit
603fd507bf
2565
package-lock.json
generated
Normal file
2565
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -4,9 +4,10 @@
|
|||||||
"description": "Stores chat messages in daily archive files",
|
"description": "Stores chat messages in daily archive files",
|
||||||
"main": "./dist/build.js",
|
"main": "./dist/build.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"build": "NODE_ENV=production webpack",
|
||||||
"dev": "webpack -w",
|
"dev": "webpack -w",
|
||||||
"build": "NODE_ENV=production webpack -p",
|
"start": "npm run dev",
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"version": "npm run build && git add dist/"
|
"version": "npm run build && git add dist/"
|
||||||
},
|
},
|
||||||
"author": "Kosmos Contributors <mail@kosmos.org> (https://kosmos.org)",
|
"author": "Kosmos Contributors <mail@kosmos.org> (https://kosmos.org)",
|
||||||
@ -16,9 +17,10 @@
|
|||||||
"url": "https://github.com/67P/remotestorage-module-chat-messages.git"
|
"url": "https://github.com/67P/remotestorage-module-chat-messages.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.18.2",
|
"@babel/core": "^7.14.8",
|
||||||
"babel-loader": "^6.2.7",
|
"@babel/preset-env": "^7.14.9",
|
||||||
"babel-preset-es2015": "^6.18.0",
|
"babel-loader": "^8.2.2",
|
||||||
"webpack": "^1.13.2"
|
"webpack": "^5.48.0",
|
||||||
|
"webpack-cli": "^4.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,31 @@
|
|||||||
var webpack = require('webpack');
|
/* global __dirname */
|
||||||
var isProd = (process.env.NODE_ENV === 'production');
|
const isProd = (process.env.NODE_ENV === 'production');
|
||||||
|
const path = require('path');
|
||||||
// minimize only in production
|
|
||||||
var plugins = isProd ? [new webpack.optimize.UglifyJsPlugin({minimize: true })] : []
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './index.js',
|
entry: ['./index.js'],
|
||||||
// source map not in production
|
|
||||||
devtool: !isProd && 'source-map',
|
|
||||||
output: {
|
output: {
|
||||||
filename: __dirname + '/dist/build.js',
|
path: path.resolve(__dirname, 'dist'),
|
||||||
libraryTarget: 'umd'
|
filename: 'build.js',
|
||||||
|
library: 'ChatMessages',
|
||||||
|
libraryTarget: 'umd',
|
||||||
|
libraryExport: 'default'
|
||||||
},
|
},
|
||||||
|
mode: isProd ? 'production' : 'development',
|
||||||
|
devtool: isProd ? 'source-map' : 'eval-source-map',
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
rules: [
|
||||||
{ test: /\.js$/, exclude: '/node_modules|dist/', loader: 'babel?presets[]=es2015' },
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: {
|
||||||
|
loader: 'babel-loader',
|
||||||
|
options: {
|
||||||
|
presets: ['@babel/preset-env']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
resolve: {
|
// plugins: plugins
|
||||||
extensions: ['', '.js']
|
|
||||||
},
|
|
||||||
plugins: plugins
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user