Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit e65b432

Browse files
author
Maxim Kerstens
committed
Added build command
1 parent 147df83 commit e65b432

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

dist/build.js

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

dist/build.js.map

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

package.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "vue-echo",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Vue integration for the Laravel Echo library.",
5-
"main": "vue-echo.js",
5+
"main": "dist/build.js",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/happyDemon/vue-echo"
@@ -18,8 +18,19 @@
1818
},
1919
"license": "MIT",
2020
"homepage": "https://github.com/happyDemon/vue-echo",
21+
"scripts": {
22+
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
23+
},
2124
"dependencies": {
2225
"laravel-echo": "^1.0.5",
2326
"pusher-js": "^3.2.1"
27+
},
28+
"devDependencies": {
29+
"babel-cli": "^6.18.0",
30+
"babel-loader": "^6.2.7",
31+
"babel-preset-es2015": "^6.18.0",
32+
"babel-preset-stage-0": "^6.16.0",
33+
"cross-env": "^3.1.3",
34+
"webpack": "^1.13.3"
2435
}
2536
}

webpack.config.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
module.exports = {
4+
entry: ['./vue-echo.js'],
5+
output: {
6+
path: path.resolve(__dirname, './dist'),
7+
filename: 'build.js',
8+
library: ['VueEcho'],
9+
libraryTarget: 'umd'
10+
},
11+
resolveLoader: {
12+
root: path.join(__dirname, 'node_modules'),
13+
},
14+
module: {
15+
loaders: [
16+
{
17+
test: /\.js$/,
18+
loader: 'babel',
19+
exclude: /node_modules/,
20+
query: {
21+
presets: ['es2015']
22+
}
23+
},
24+
{
25+
test: /\.json$/,
26+
loader: 'json'
27+
}
28+
]
29+
},
30+
devtool: 'eval-source-map'
31+
}
32+
33+
if (process.env.NODE_ENV === 'production') {
34+
module.exports.devtool = 'source-map'
35+
36+
module.exports.plugins = (module.exports.plugins || []).concat([
37+
new webpack.DefinePlugin({
38+
'process.env': {
39+
NODE_ENV: '"production"'
40+
}
41+
}),
42+
new webpack.optimize.UglifyJsPlugin({
43+
compress: {
44+
warnings: false
45+
}
46+
}),
47+
new webpack.optimize.OccurenceOrderPlugin()
48+
])
49+
}

0 commit comments

Comments
 (0)