Core-JS: README.md was updated and the webpack

This commit is contained in:
Ezequiel-Vega 2021-09-23 14:25:22 -03:00
parent 0567dedb88
commit 5db32ca80f
4 changed files with 53 additions and 52 deletions

View File

@ -1,11 +1,38 @@
# `core-js`
> TODO: description
Core-JS defines custom functions for the **Wisemapping** ecosystem.
## Quick Start
1. Clone repository with the next command:
```
git clone https://[username]@bitbucket.org/wisemapping/wisemapping-frontend.git
```
where the variable _username_ is you username of Bitbucket.
_Note:The project is configured to use the yarn dependency manager_
2. Move to folder core-js
```
cd packages/core-js
```
3. Now you need install all dependence, this is done with command `yarn install`
4. To start the development enviroment you have to use command `yarn start`.
## Production
To build up the package core-js and use in production, you have to use command `yarn build`
## Usage
To start using core-js it has to be required as a module and then intanciarce as a function
```
const coreJs = require('core-js');
// TODO: DEMONSTRATE API
coreJs();
```

View File

@ -1,9 +1,9 @@
const path = require('path'); // eslint-disable-line
//const { ProvidePlugin } = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); // eslint-disable-line
/** @type {import('webpack').Configuration} */
module.exports = { // eslint-disable-line
module.exports = {
// eslint-disable-line
entry: './lib/core.js',
output: {
path: path.resolve(__dirname, 'dist'), // eslint-disable-line
@ -28,32 +28,3 @@ module.exports = { // eslint-disable-line
},
plugins: [new CleanWebpackPlugin()],
};
/*
*{
core: [
path.resolve(__dirname, '../mindplot/src/main/javascript/Options'),
path.resolve(
__dirname,
'../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog'
),
path.resolve(
__dirname,
'../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request'
),
],
},
Options: path.resolve(path.join(__dirname, '../mindplot/src/main/javascript/Options')),
BootstrapDialog: path.resolve(
path.join(
__dirname,
'../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog'
)
),
BootstrapDialogRequest: path.resolve(
path.join(
__dirname,
'../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request'
)
),
* */

View File

@ -1,14 +1,18 @@
const { HotModuleReplacementPlugin } = require("webpack");
const { merge } = require("webpack-merge");
const common = require("./webpack.common");
const { HotModuleReplacementPlugin } = require('webpack');
const { merge } = require('webpack-merge');
const common = require('./webpack.common');
/** @type {import('webpack').Configuration} */
const devConfig = {
mode: "development",
target: "core",
mode: 'development',
target: 'web',
plugins: [new HotModuleReplacementPlugin()],
devtool: "eval-source-map"
devtool: 'eval-source-map',
devServer: {
port: 8080,
open: 'google-chrome-stable',
hot: true,
},
};
module.exports = merge(common, devConfig)
module.exports = merge(common, devConfig);

View File

@ -1,16 +1,15 @@
const { merge } = require("webpack-merge");
const common = require("./webpack.common");
const { merge } = require('webpack-merge');
const common = require('./webpack.common');
/** @type {import('webpack').Configuration} */
const prodConfig = {
mode: "production",
devtool: "source-map",
mode: 'production',
devtool: 'source-map',
optimization: {
splitChunks: {
chunks: "all",
chunks: 'all',
},
},
}
};
module.exports = merge(common, prodConfig);