mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Add simple webpack builder into the project
This commit is contained in:
parent
0bcb5713cd
commit
5149acc2c5
3
.babelrc
3
.babelrc
@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"presets": ["env"],
|
"presets": ["env"],
|
||||||
|
"plugins": [
|
||||||
|
"add-module-exports"
|
||||||
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"test": {
|
"test": {
|
||||||
"plugins": [ "istanbul" ],
|
"plugins": [ "istanbul" ],
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ node_modules/
|
|||||||
/lib/
|
/lib/
|
||||||
.nyc_output
|
.nyc_output
|
||||||
coverage
|
coverage
|
||||||
|
dist
|
||||||
|
@ -3,3 +3,4 @@ src/useragents.js
|
|||||||
Makefile
|
Makefile
|
||||||
.nyc_output
|
.nyc_output
|
||||||
coverage
|
coverage
|
||||||
|
dist
|
||||||
|
5687
package-lock.json
generated
5687
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -29,6 +29,9 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "^0.25.0",
|
"ava": "^0.25.0",
|
||||||
"babel-cli": "^6.26.0",
|
"babel-cli": "^6.26.0",
|
||||||
|
"babel-core": "^6.26.3",
|
||||||
|
"babel-loader": "^7.1.5",
|
||||||
|
"babel-plugin-add-module-exports": "^0.3.1",
|
||||||
"babel-plugin-istanbul": "^4.1.6",
|
"babel-plugin-istanbul": "^4.1.6",
|
||||||
"babel-preset-env": "^1.7.0",
|
"babel-preset-env": "^1.7.0",
|
||||||
"babel-register": "^6.26.0",
|
"babel-register": "^6.26.0",
|
||||||
@ -42,6 +45,8 @@
|
|||||||
"nyc": "^12.0.2",
|
"nyc": "^12.0.2",
|
||||||
"sinon": "^2.4.1",
|
"sinon": "^2.4.1",
|
||||||
"testem": "^1.18.5",
|
"testem": "^1.18.5",
|
||||||
|
"webpack": "^4.15.1",
|
||||||
|
"webpack-cli": "^3.0.8",
|
||||||
"yamljs": "^0.3.0"
|
"yamljs": "^0.3.0"
|
||||||
},
|
},
|
||||||
"ava": {
|
"ava": {
|
||||||
@ -63,8 +68,5 @@
|
|||||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||||
"docs": "jsdoc -c jsdoc.json"
|
"docs": "jsdoc -c jsdoc.json"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"dependencies": {
|
|
||||||
"semver": "^5.5.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
35
webpack.config.js
Normal file
35
webpack.config.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
mode: 'production', // "production" | "development" | "none"
|
||||||
|
// Chosen mode tells webpack to use its built-in optimizations accordingly.
|
||||||
|
entry: './src/bowser.js', // string | object | array
|
||||||
|
// defaults to ./src
|
||||||
|
// Here the application starts executing
|
||||||
|
// and webpack starts bundling
|
||||||
|
output: {
|
||||||
|
// options related to how webpack emits results
|
||||||
|
path: path.resolve(__dirname, 'dist'), // string
|
||||||
|
// the target directory for all output files
|
||||||
|
// must be an absolute path (use the Node.js path module)
|
||||||
|
filename: 'bowser.compiled.js', // string
|
||||||
|
// the filename template for entry chunks
|
||||||
|
library: 'bowser',
|
||||||
|
libraryTarget: 'umd', // universal module definition
|
||||||
|
// the type of the exported library
|
||||||
|
globalObject: 'this',
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
// configuration regarding modules
|
||||||
|
rules: [
|
||||||
|
// rules for modules (configure loaders, parser options, etc.)
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: /(node_modules|bower_components)/,
|
||||||
|
use: {
|
||||||
|
loader: 'babel-loader',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user