Skip to content

Commit 818fea9

Browse files
committedJul 21, 2018
Added configuration files
1 parent 1d9e407 commit 818fea9

5 files changed

+128
-0
lines changed
 

‎package.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "bit-array",
3+
"description": "Bit array implementation in javascript",
4+
"version": "0.1.0",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/Bubblesphere/bit-array.git"
8+
},
9+
"keywords": [
10+
"bit",
11+
"array",
12+
"typescript",
13+
"javascript"
14+
],
15+
"author": "Déric Dallaire",
16+
"license": "MIT",
17+
"bugs": {
18+
"url": "https://github.com/Bubblesphere/bit-array/issues"
19+
},
20+
"homepage": "https://github.com/Bubblesphere/bit-array",
21+
"devDependencies": {
22+
"babel-preset-es2015": "^6.24.1",
23+
"clean-webpack-plugin": "^0.1.19",
24+
"copy-webpack-plugin": "^4.5.1",
25+
"ts-loader": "^4.1.0",
26+
"typescript": "^2.7.2",
27+
"webpack": "^4.1.1",
28+
"webpack-bundle-analyzer": "^2.11.1",
29+
"webpack-cli": "^2.0.12",
30+
"webpack-dev-server": "^3.1.1",
31+
"webpack-merge": "^4.1.2"
32+
},
33+
"scripts": {
34+
"start": "webpack-dev-server --open-page dev/index.html --config webpack.dev.js --mode development ",
35+
"build": "webpack --config webpack.prod.js --mode production"
36+
}
37+
}

‎tsconfig.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"module": "esnext",
4+
"noImplicitAny": true,
5+
"removeComments": true,
6+
"preserveConstEnums": true,
7+
"sourceMap": true,
8+
"target": "es5"
9+
},
10+
"include": [
11+
"src/**/*"
12+
],
13+
"exclude": [
14+
"node_modules",
15+
"**/*.test.ts"
16+
]
17+
}

‎webpack.common.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
var path = require("path");
2+
const webpack = require('webpack');
3+
const CleanWebpackPlugin = require('clean-webpack-plugin');
4+
const CopyWebpackPlugin = require('copy-webpack-plugin');
5+
6+
module.exports = {
7+
target: 'web',
8+
resolve: {
9+
extensions: ['.ts', '.tsx', '.js']
10+
},
11+
entry: {
12+
index: "./src/demo/index.ts"
13+
},
14+
output: {
15+
filename: "[name]-bundle.js",
16+
path: path.resolve(__dirname, "dev"),
17+
publicPath: "/dev/"
18+
},
19+
// Demos use the same library, bundle the code in common into a diff file
20+
optimization: {
21+
splitChunks: {
22+
chunks: "all",
23+
minSize: 1000,
24+
name: "common"
25+
}
26+
},
27+
plugins: [
28+
new CopyWebpackPlugin([{
29+
from: 'src/demo/*.html',
30+
flatten: true
31+
}])
32+
],
33+
module: {
34+
rules: [
35+
{
36+
test: /\.tsx?$/,
37+
loader: "ts-loader",
38+
}
39+
]
40+
}
41+
};

‎webpack.dev.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
stats: {
8+
assets: false,
9+
hash: false,
10+
chunks: false,
11+
errors: true,
12+
errorDetails: true,
13+
},
14+
overlay: true,
15+
}
16+
});

‎webpack.prod.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const merge = require('webpack-merge');
2+
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
3+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
4+
const common = require('./webpack.common.js');
5+
6+
7+
module.exports = merge(common, {
8+
// remove comment to get source map in production
9+
//devtool: 'source-map',
10+
plugins: [
11+
new BundleAnalyzerPlugin(),
12+
new UglifyJSPlugin({
13+
// remove comment to get source map in production
14+
//sourceMap: true
15+
})
16+
]
17+
});

0 commit comments

Comments
 (0)
Please sign in to comment.