Skip to content

Commit e0dbf4f

Browse files
author
Burak Targaç
committed
webpack, babel and jest configs are added
1 parent 9af1f90 commit e0dbf4f

8 files changed

+6916
-3
lines changed

Diff for: .babelrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"env": {
3+
"test": {
4+
"presets": ["@babel/preset-env"]
5+
}
6+
}
7+
}

Diff for: .editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

Diff for: package-lock.json

+6,824
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+28-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22
"name": "excel-parser-processor",
33
"version": "1.0.0",
44
"description": "Does the tedious processing over all items of a given excel file by converting the rows to an array and process all items of that array recursively",
5-
"main": "index.js",
5+
"main": "./src/index.js",
66
"scripts": {
7-
"test": "jest"
7+
"build": "webpack --config webpack.prod.js",
8+
"start": "webpack --watch --config webpack.dev.js",
9+
"test": "jest --coverage",
10+
"test-watch": "jest --coverage --watch"
11+
},
12+
"jest": {
13+
"transform": {
14+
"^.+\\.jsx?$": "babel-jest"
15+
},
16+
"testPathIgnorePatterns": [
17+
"<rootDir>/dist/",
18+
"<rootDir>/node_modules/"
19+
]
820
},
921
"repository": {
1022
"type": "git",
@@ -23,5 +35,18 @@
2335
"bugs": {
2436
"url": "https://github.com/btargac/excel-parser-processor/issues"
2537
},
26-
"homepage": "https://github.com/btargac/excel-parser-processor#readme"
38+
"homepage": "https://github.com/btargac/excel-parser-processor#readme",
39+
"devDependencies": {
40+
"@babel/core": "^7.0.0-beta.40",
41+
"@babel/plugin-transform-runtime": "^7.0.0-beta.40",
42+
"@babel/preset-env": "^7.0.0-beta.40",
43+
"@babel/runtime": "^7.0.0-beta.40",
44+
"babel-jest": "^22.4.0",
45+
"babel-loader": "^8.0.0-beta.0",
46+
"clean-webpack-plugin": "^0.1.18",
47+
"jest": "^22.4.0",
48+
"uglifyjs-webpack-plugin": "^1.2.0",
49+
"webpack": "^3.11.0",
50+
"webpack-merge": "^4.1.1"
51+
}
2752
}

Diff for: src/index.js

Whitespace-only changes.

Diff for: webpack.common.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require('path');
2+
const CleanWebpackPlugin = require('clean-webpack-plugin');
3+
4+
module.exports = {
5+
entry: {
6+
app: './src/index.js'
7+
},
8+
plugins: [
9+
new CleanWebpackPlugin(['dist'])
10+
],
11+
module: {
12+
rules: [
13+
{
14+
test: /\.js$/,
15+
exclude: /(node_modules|bower_components)/,
16+
use: {
17+
loader: 'babel-loader',
18+
options: {
19+
presets: ['@babel/preset-env'],
20+
plugins: ['@babel/transform-runtime']
21+
}
22+
}
23+
}
24+
]
25+
},
26+
output: {
27+
filename: '[name].bundle.js',
28+
path: path.resolve(__dirname, 'dist')
29+
}
30+
};

Diff for: webpack.dev.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const merge = require('webpack-merge');
2+
const common = require('./webpack.common.js');
3+
4+
module.exports = merge(common, {
5+
devtool: 'inline-source-map',
6+
devServer: {
7+
contentBase: './dist'
8+
}
9+
});

Diff for: webpack.prod.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const merge = require('webpack-merge');
2+
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
3+
const common = require('./webpack.common.js');
4+
5+
module.exports = merge(common, {
6+
plugins: [
7+
new UglifyJSPlugin()
8+
]
9+
});

0 commit comments

Comments
 (0)