Skip to content

Commit

Permalink
Webpack changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pespantelis committed May 20, 2016
1 parent 98b92c7 commit c48abb8
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .babelrc
@@ -0,0 +1,5 @@
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"],
"comments": false
}
9 changes: 9 additions & 0 deletions .editorconfig
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,2 +1 @@
/build
/node_modules
node_modules/
12 changes: 7 additions & 5 deletions .npmignore
@@ -1,5 +1,7 @@
/.idea
/.editorconfig
/.npmignore
/build
/webpack.config.js
.idea/
.babelrc
.editorconfig
.npmignore
demo/
index.html
webpack.config.js
40 changes: 20 additions & 20 deletions package.json
Expand Up @@ -16,28 +16,28 @@
"bugs": "https://github.com/pespantelis/vue-typeahead/issues",
"homepage": "http://pespantelis.github.io/vue-typeahead/",
"scripts": {
"dev": "webpack --watch"
},
"devDependencies": {
"babel": "^6.3.26",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.3.13",
"webpack": "^1.0.0"
"dev": "webpack-dev-server --content-base demo/ --inline --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
"dist": "rollup src/main.js -o dist/vue-typeahead.js -f cjs"
},
"dependencies": {
"vue": "^1.0.12",
"vue-resource": "^0.5.1"
"babel-runtime": "^6.0.0",
"vue": "^1.0.21",
"vue-resource": "^0.7.0"
},
"browserify": {
"transform": [
[
"babelify",
{
"presets": [
"es2015"
]
}
]
]
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"cross-env": "^1.0.6",
"css-loader": "^0.23.0",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.0.0",
"vue-loader": "^8.3.0",
"vue-style-loader": "^1.0.0",
"webpack": "^1.12.2",
"webpack-dev-server": "^1.12.0"
}
}
File renamed without changes.
37 changes: 32 additions & 5 deletions webpack.config.js
@@ -1,18 +1,45 @@
var webpack = require('webpack')

module.exports = {
entry: './vue-typeahead.js',
entry: './demo/main.js',
output: {
path: './build',
path: './demo/build',
publicPath: '/build/',
filename: 'build.js'
},
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: { presets: ['es2015'] }
exclude: /node_modules/
}
]
},
devtool: '#source-map'
devServer: {
historyApiFallback: true,
noInfo: true
},
devtool: '#eval-source-map'
}

if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
])
}

0 comments on commit c48abb8

Please sign in to comment.