Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
fix: adjust web pack invocation on post install build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evandro Carenho committed Mar 29, 2017
1 parent 36a6604 commit 53c0822
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 13 deletions.
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
# Maven
target/

# Intellij
.idea
*.iml

# NPM
node_modules/
dist/

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Common components for 3rd party developers build the user facing application for Symphony Integrations.",
"main": "./dist/index.bundle.js",
"scripts": {
"build": "./node_modules/webpack/bin/webpack.js -p --config webpack.config.prod.js",
"postinstall": "npm run build",
"build": "webpack -p --config webpack.config.prod.js",
"postinstall": "webpack -p --config webpack.post.install.js",
"test": "jest",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"license-check": "node-license-validator --allow-licenses WTFPL Apache Apache-2 BSD-like BSD BSD-2-Clause BSD-3-Clause Apache-2.0 MIT ISC Unlicense MIT/X11 \"MIT / http://rem.mit-license.org\" \"Public Domain\" --allow-packages map-stream@0.1.0 domelementtype@1.3.0 domhandler@2.3.0 domutils@1.5.1 extsprintf@1.0.2 ripemd160@0.2.0 rx-lite@3.1.2 shellwords@0.1.0 stream-cache@0.0.2 verror@1.3.6"
Expand Down Expand Up @@ -50,6 +50,7 @@
"semantic-release": "^6.3.2",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1"
},
"dependencies": {
Expand All @@ -61,8 +62,7 @@
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"redux": "^3.6.0",
"redux-saga": "^0.14.3",
"webpack": "^1.12.14"
"redux-saga": "^0.14.3"
},
"repository": {
"type": "git",
Expand Down
52 changes: 52 additions & 0 deletions webpack.post.install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* eslint-disable */
var webpack = require('webpack');
var path = require("path"),
CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
entry: path.resolve(__dirname, "./index.jsx"),
output: {
path: path.resolve(__dirname, "./dist"),
filename: "index.bundle.js"
},
devtool: 'eval-source-map',
module: {
preLoaders: [
{ test: /\.jsx?$/, loader: 'eslint', exclude: /node_modules/ }
],
loaders: [
{ test: /\.css$/, loader: "style!css" },
{ test: /\.less$/, loader: "style!css!less" },
{
test: /\.jsx?$/,
loader: 'babel',
query: {
presets: ['react', 'es2015'],
plugins: ['transform-object-rest-spread'],
}
},
{ test: /\.(jpe?g|png|gif|svg)$/i, loader: 'url?limit=10000!img?progressive=true' },
{ test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff' },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream' },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml' }
]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
eslint: {
configFile: './.eslintrc',
failOnWarning: false,
failOnError: true,
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'), // Tells React to build in either dev or prod modes. https://facebook.github.io/react/downloads.html (See bottom)
__DEV__: false
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.AggressiveMergingPlugin()
]
};

0 comments on commit 53c0822

Please sign in to comment.