aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-09-28 16:09:43 +0300
committerValentin Popov <info@valentineus.link>2017-09-28 16:09:43 +0300
commit5e4bfac39a53498f457d02ff5aac3653a6c822df (patch)
tree6b4cd9249a6c247ff1e4f5e5fef86a901b87e0d5
parenta40cbab6100d4c227c89155333f4700e7b6674f1 (diff)
downloadiii-client-5e4bfac39a53498f457d02ff5aac3653a6c822df.tar.xz
iii-client-5e4bfac39a53498f457d02ff5aac3653a6c822df.zip
Added assembly for the browser
-rw-r--r--.babelrc2
-rw-r--r--package.json8
-rw-r--r--webpack.config.js25
3 files changed, 32 insertions, 3 deletions
diff --git a/.babelrc b/.babelrc
index ef0ccae..0c77244 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,5 +1,5 @@
{
presets: ["es2015"],
- sourceMaps: "both",
+ sourceMaps: false,
comments: false
} \ No newline at end of file
diff --git a/package.json b/package.json
index 2fcf507..95aba53 100644
--- a/package.json
+++ b/package.json
@@ -26,11 +26,15 @@
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
+ "babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
- "eslint": "^3.19.0"
+ "eslint": "^3.19.0",
+ "webpack": "^3.6.0"
},
"scripts": {
- "build": "babel --source-maps --out-file ./dist/index.js ./src/index.js",
+ "build-node": "babel --out-file ./dist/index.js ./src/index.js",
+ "build-browser": "webpack --config webpack.config.js",
+ "build": "npm run build-browser && npm run build-node",
"check": "eslint ./src/*"
}
}
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 0000000..ec23cbd
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,25 @@
+'use strict';
+var webpack = require('webpack');
+var path = require('path');
+
+module.exports = {
+ entry: path.resolve(__dirname, 'src/index.js'),
+
+ output: {
+ filename: 'bundle.js',
+ path: path.resolve(__dirname, 'dist')
+ },
+
+ module: {
+ rules: [{
+ test: /\.js$/,
+ exclude: /(node_modules|bower_components)/,
+ use: {
+ loader: 'babel-loader',
+ options: {
+ presets: ['es2015']
+ }
+ }
+ }]
+ }
+}; \ No newline at end of file