+
Some already thought about our basil
- { donations.length === 0 ?
Loading... :
{this._buildDonationsList(donations)}
}
+ { donations.length === 0
+ ?
Loading...
+ :
{this._buildDonationsList(donations)}
}
- )
+ );
}
- _buildDonationsList(donations) {
+ _buildDonationsList (donations) {
return donations.map((donation, index) => {
- const style = { backgroundColor: `rgb(${[donation.r, donation.g, donation.b]})` }
+ const style = { backgroundColor: `rgb(${[donation.r, donation.g, donation.b]})` };
return (
@@ -35,13 +36,13 @@ class DonationsList extends React.Component {
ETH {donation.value}
- )
- })
+ );
+ });
}
}
-function mapStateToProps({ donations }) {
- return { donations }
+function mapStateToProps ({ donations }) {
+ return { donations };
}
-export default connect(mapStateToProps)(DonationsList)
+export default connect(mapStateToProps)(DonationsList);
diff --git a/src/js/components/Modal.react.js b/src/js/components/Modal.react.js
index 9136095..d4c4e74 100644
--- a/src/js/components/Modal.react.js
+++ b/src/js/components/Modal.react.js
@@ -1,18 +1,18 @@
-import React from 'react'
+import React from 'react';
class Modal extends React.Component {
- constructor(props){
- super(props)
- this.state = { open: this.props.open, message: this.props.message, progressBar: this.props.progressBar }
+ constructor (props) {
+ super(props);
+ this.state = { open: this.props.open, message: this.props.message, progressBar: this.props.progressBar };
}
- componentWillReceiveProps(nextProps) {
- this.setState({ open: nextProps.open, message: nextProps.message })
+ componentWillReceiveProps (nextProps) {
+ this.setState({ open: nextProps.open, message: nextProps.message });
}
- render() {
- let cssClass = this.state.open ? '' : 'hidden'
- cssClass += this.props.dark ? ' dark' : ''
+ render () {
+ let cssClass = this.state.open ? '' : 'hidden';
+ cssClass += this.props.dark ? ' dark' : '';
return (
@@ -20,15 +20,17 @@ class Modal extends React.Component {
{this._renderProgressBar()}
- )
+ );
}
- _renderProgressBar() {
- if(this.state.progressBar) return (
-
- )
+ _renderProgressBar () {
+ if (this.state.progressBar) {
+ return (
+
+ );
+ }
}
}
diff --git a/src/js/components/Navbar.react.js b/src/js/components/Navbar.react.js
index 5d78e0e..3a5e3b4 100644
--- a/src/js/components/Navbar.react.js
+++ b/src/js/components/Navbar.react.js
@@ -1,17 +1,16 @@
-import React from 'react'
-import Store from '../store'
-import { connect } from 'react-redux'
-import { Link } from 'react-router-dom'
-import BasilActions from "../actions/basil";
+import React from 'react';
+import Store from '../store';
+import { connect } from 'react-redux';
+import { Link } from 'react-router-dom';
+import BasilActions from '../actions/basil';
class Navbar extends React.Component {
-
- componentWillMount() {
- Store.dispatch(BasilActions.find())
+ componentWillMount () {
+ Store.dispatch(BasilActions.find());
}
- render() {
- const basil = this.props.basil
+ render () {
+ const basil = this.props.basil;
return (
- )
+ );
}
}
-function mapStateToProps({ basil }) {
- return { basil }
+function mapStateToProps ({ basil }) {
+ return { basil };
}
-export default connect(mapStateToProps)(Navbar)
+export default connect(mapStateToProps)(Navbar);
diff --git a/src/js/components/Root.react.js b/src/js/components/Root.react.js
index 0a3eff5..46a3005 100644
--- a/src/js/components/Root.react.js
+++ b/src/js/components/Root.react.js
@@ -1,7 +1,7 @@
-import React from 'react'
-import App from './App.react'
-import { Provider } from 'react-redux'
-import { HashRouter } from 'react-router-dom'
+import React from 'react';
+import App from './App.react';
+import { Provider } from 'react-redux';
+import { HashRouter } from 'react-router-dom';
const Root = ({ store }) => (
@@ -9,6 +9,6 @@ const Root = ({ store }) => (
-)
+);
-export default Root
+export default Root;
diff --git a/src/js/contracts.js b/src/js/contracts.js
index 63d3b94..b4aee43 100644
--- a/src/js/contracts.js
+++ b/src/js/contracts.js
@@ -1,5 +1,5 @@
-import Network from './network'
-import contract from 'truffle-contract'
+import Network from './network';
+import contract from 'truffle-contract';
const provider = Network.provider();
@@ -8,4 +8,4 @@ Basil.setProvider(provider);
export {
Basil,
-}
+};
diff --git a/src/js/helpers/fromWei.js b/src/js/helpers/fromWei.js
index 27b037a..812b092 100644
--- a/src/js/helpers/fromWei.js
+++ b/src/js/helpers/fromWei.js
@@ -1,5 +1,5 @@
-import Network from "../network";
+import Network from '../network';
-export default function fromWei(amount) {
- return Network.web3().fromWei(amount, 'ether')
+export default function fromWei (amount) {
+ return Network.web3().fromWei(amount, 'ether');
}
diff --git a/src/js/helpers/toWei.js b/src/js/helpers/toWei.js
index d436c28..7cf93a4 100644
--- a/src/js/helpers/toWei.js
+++ b/src/js/helpers/toWei.js
@@ -1,5 +1,5 @@
-import Network from "../network";
+import Network from '../network';
-export default function toWei(amount) {
- return Network.web3().toWei(amount, 'ether')
+export default function toWei (amount) {
+ return Network.web3().toWei(amount, 'ether');
}
diff --git a/src/js/network.js b/src/js/network.js
index 9ab524e..032db8a 100644
--- a/src/js/network.js
+++ b/src/js/network.js
@@ -1,66 +1,66 @@
import Web3 from 'web3';
-import { ACTIVE_NETWORK } from 'constants'
+import { ACTIVE_NETWORK } from 'constants';
const Network = {
- web3() {
- return new Web3(this.provider())
+ web3 () {
+ return new Web3(this.provider());
},
- eth() {
+ eth () {
return this.web3().eth;
},
- provider() {
- if (typeof web3 !== 'undefined') return web3.currentProvider
+ provider () {
+ if (typeof web3 !== 'undefined') return web3.currentProvider;
const provider = `${ACTIVE_NETWORK.host}:${ACTIVE_NETWORK.port}`;
return new Web3.providers.HttpProvider(provider);
},
- async validateCode(address, code) {
- const foundCode = await Network.getCode(address)
- const cleanFoundCode = foundCode ? foundCode.replace("0x", "").replace(/0/g, "") : ''
+ async validateCode (address, code) {
+ const foundCode = await Network.getCode(address);
+ const cleanFoundCode = foundCode ? foundCode.replace('0x', '').replace(/0/g, '') : '';
return cleanFoundCode === code;
},
- getCode(address) {
+ getCode (address) {
return new Promise(function (resolve, reject) {
- Network.eth().getCode(address, Network._web3Callback(resolve, reject))
+ Network.eth().getCode(address, Network._web3Callback(resolve, reject));
});
},
- getAccounts() {
+ getAccounts () {
return new Promise(function (resolve, reject) {
- Network.eth().getAccounts(Network._web3Callback(resolve, reject))
+ Network.eth().getAccounts(Network._web3Callback(resolve, reject));
});
},
- getBalance(address) {
+ getBalance (address) {
return new Promise(function (resolve, reject) {
- Network.eth().getBalance(address, Network._web3Callback(resolve, reject))
+ Network.eth().getBalance(address, Network._web3Callback(resolve, reject));
});
},
- getTransaction(txHash) {
+ getTransaction (txHash) {
return new Promise(function (resolve, reject) {
- Network.eth().getTransaction(txHash, Network._web3Callback(resolve, reject))
+ Network.eth().getTransaction(txHash, Network._web3Callback(resolve, reject));
});
},
- promisified(group, method, ...args) {
+ promisified (group, method, ...args) {
return new Promise(function (resolve, reject) {
let parameters = args;
parameters[args.length] = callback(resolve, reject);
parameters.length++;
Network.web3()[group][method].apply(web3[group], parameters);
- })
+ });
},
- _web3Callback(resolve, reject) {
+ _web3Callback (resolve, reject) {
return function (error, value) {
if (error) reject(error);
else resolve(value);
- }
- }
-}
+ };
+ },
+};
-export default Network
+export default Network;
diff --git a/src/js/reducers/accounts.js b/src/js/reducers/accounts.js
index 6dc4150..be7320c 100644
--- a/src/js/reducers/accounts.js
+++ b/src/js/reducers/accounts.js
@@ -1,16 +1,15 @@
-import React from 'react';
-import * as ActionTypes from '../actiontypes'
+import * as ActionTypes from '../actiontypes';
const initialState = { address: '', balance: 0 };
const AccountsReducer = (state = initialState, action) => {
switch (action.type) {
- case ActionTypes.RECEIVE_ACCOUNT:
- return Object.assign({}, state, { address: action.address });
- case ActionTypes.RECEIVE_ETHER_BALANCE:
- return Object.assign({}, state, { balance: action.balance.toString() });
- default:
- return state
+ case ActionTypes.RECEIVE_ACCOUNT:
+ return Object.assign({}, state, { address: action.address });
+ case ActionTypes.RECEIVE_ETHER_BALANCE:
+ return Object.assign({}, state, { balance: action.balance.toString() });
+ default:
+ return state;
}
};
diff --git a/src/js/reducers/alerts.js b/src/js/reducers/alerts.js
index 9535b60..86c5b7f 100644
--- a/src/js/reducers/alerts.js
+++ b/src/js/reducers/alerts.js
@@ -1,14 +1,13 @@
-import React from 'react';
-import * as ActionTypes from '../actiontypes'
+import * as ActionTypes from '../actiontypes';
const AlertsReducer = (state = null, action) => {
switch (action.type) {
- case ActionTypes.SHOW_ERROR:
- return { message: action.message };
- case ActionTypes.RESET_ERROR:
- return null;
- default:
- return state
+ case ActionTypes.SHOW_ERROR:
+ return { message: action.message };
+ case ActionTypes.RESET_ERROR:
+ return null;
+ default:
+ return state;
}
};
diff --git a/src/js/reducers/basil.js b/src/js/reducers/basil.js
index cf61007..7d86aa7 100644
--- a/src/js/reducers/basil.js
+++ b/src/js/reducers/basil.js
@@ -1,12 +1,11 @@
-import React from 'react';
-import * as ActionTypes from '../actiontypes'
+import * as ActionTypes from '../actiontypes';
-const BasilReducer = (state = { highestDonation: 0, r: 0, g: 0, b: 0}, action) => {
+const BasilReducer = (state = { highestDonation: 0, r: 0, g: 0, b: 0 }, action) => {
switch (action.type) {
- case ActionTypes.RECEIVE_BASIL:
- return action.basil;
- default:
- return state
+ case ActionTypes.RECEIVE_BASIL:
+ return action.basil;
+ default:
+ return state;
}
};
diff --git a/src/js/reducers/donations.js b/src/js/reducers/donations.js
index e0e9274..1f15c9b 100644
--- a/src/js/reducers/donations.js
+++ b/src/js/reducers/donations.js
@@ -1,19 +1,18 @@
-import React from 'react';
-import * as ActionTypes from '../actiontypes'
+import * as ActionTypes from '../actiontypes';
-const initialState = { list: [], donation: null }
+const initialState = { list: [], donation: null };
const DonationsReducer = (state = initialState, action) => {
switch (action.type) {
- case ActionTypes.ADD_DONATION:
- let donations = state.list;
- return Object.assign({}, state, { list: [action.donation].concat(donations) })
- case ActionTypes.RESET_DONATION:
- return Object.assign({}, state, { donation: null })
- case ActionTypes.RECEIVE_DONATION:
- return Object.assign({}, state, { donation: action.donation })
- default:
- return state
+ case ActionTypes.ADD_DONATION:
+ let donations = state.list;
+ return Object.assign({}, state, { list: [action.donation].concat(donations) });
+ case ActionTypes.RESET_DONATION:
+ return Object.assign({}, state, { donation: null });
+ case ActionTypes.RECEIVE_DONATION:
+ return Object.assign({}, state, { donation: action.donation });
+ default:
+ return state;
}
};
diff --git a/src/js/reducers/fetching.js b/src/js/reducers/fetching.js
index 8d7dc72..375043f 100644
--- a/src/js/reducers/fetching.js
+++ b/src/js/reducers/fetching.js
@@ -1,14 +1,13 @@
-import React from 'react';
-import * as ActionTypes from '../actiontypes'
+import * as ActionTypes from '../actiontypes';
const FetchingReducer = (state = null, action) => {
switch (action.type) {
- case ActionTypes.START_FETCHING:
- return action.message
- case ActionTypes.STOP_FETCHING:
- return null
- default:
- return state
+ case ActionTypes.START_FETCHING:
+ return action.message;
+ case ActionTypes.STOP_FETCHING:
+ return null;
+ default:
+ return state;
}
};
diff --git a/src/js/reducers/network.js b/src/js/reducers/network.js
index 5ff3b79..9452e97 100644
--- a/src/js/reducers/network.js
+++ b/src/js/reducers/network.js
@@ -1,21 +1,20 @@
-import React from 'react';
-import * as ActionTypes from '../actiontypes'
+import * as ActionTypes from '../actiontypes';
-const initialState = { connected: null, couldAccessAccount: null }
+const initialState = { connected: null, couldAccessAccount: null };
const NetworkReducer = (state = initialState, action) => {
switch (action.type) {
- case ActionTypes.CONNECTION_FAILED:
- return Object.assign({}, state, { connected: false })
- case ActionTypes.CONNECTION_SUCCEEDED:
- return Object.assign({}, state, { connected: true })
- case ActionTypes.COULD_ACCESS_ACCOUNT:
- return Object.assign({}, state, { couldAccessAccount: true })
- case ActionTypes.COULD_NOT_ACCESS_ACCOUNT:
- return Object.assign({}, state, { couldAccessAccount: false })
- default:
- return state
+ case ActionTypes.CONNECTION_FAILED:
+ return Object.assign({}, state, { connected: false });
+ case ActionTypes.CONNECTION_SUCCEEDED:
+ return Object.assign({}, state, { connected: true });
+ case ActionTypes.COULD_ACCESS_ACCOUNT:
+ return Object.assign({}, state, { couldAccessAccount: true });
+ case ActionTypes.COULD_NOT_ACCESS_ACCOUNT:
+ return Object.assign({}, state, { couldAccessAccount: false });
+ default:
+ return state;
}
-}
+};
-export default NetworkReducer
+export default NetworkReducer;
diff --git a/src/js/store.js b/src/js/store.js
index 0f94c30..0853a49 100644
--- a/src/js/store.js
+++ b/src/js/store.js
@@ -1,12 +1,11 @@
-import React from 'react'
-import thunkMiddleware from 'redux-thunk'
-import basil from './reducers/basil'
-import alert from './reducers/alerts'
-import network from './reducers/network'
-import account from './reducers/accounts'
-import fetching from './reducers/fetching'
-import donations from './reducers/donations'
-import { createStore, combineReducers, applyMiddleware } from 'redux'
+import thunkMiddleware from 'redux-thunk';
+import basil from './reducers/basil';
+import alert from './reducers/alerts';
+import network from './reducers/network';
+import account from './reducers/accounts';
+import fetching from './reducers/fetching';
+import donations from './reducers/donations';
+import { createStore, combineReducers, applyMiddleware } from 'redux';
const mainReducer = combineReducers({
alert,
diff --git a/test/Basil.test.js b/test/Basil.test.js
index bc66473..8a0cbd4 100644
--- a/test/Basil.test.js
+++ b/test/Basil.test.js
@@ -5,20 +5,18 @@ import assertRevert from './helpers/assertRevert';
const Basil = artifacts.require('Basil');
contract('Basil', (accounts) => {
- describe('implementation', function() {
+ describe('implementation', function () {
shouldBehaveLikeBasil(Basil, accounts);
});
});
-function shouldBehaveLikeBasil(ContractKlazz, [_, proxyOwner, owner, aWallet, someone, anotherone]) {
-
+function shouldBehaveLikeBasil (ContractKlazz, [_, proxyOwner, owner, aWallet, someone, anotherone]) {
beforeEach(async function () {
this.basil = await ContractKlazz.new();
await this.basil.initialize(owner);
});
describe('donate', function () {
-
describe('when there are no donations', function () {
const donor = someone;
@@ -125,14 +123,13 @@ function shouldBehaveLikeBasil(ContractKlazz, [_, proxyOwner, owner, aWallet, so
const secondDonation = 2;
it('reverts', async function () {
- await assertRevert(this.basil.sendTransaction({ from: anotherDonor, value: secondDonation }))
+ await assertRevert(this.basil.sendTransaction({ from: anotherDonor, value: secondDonation }));
});
});
describe('when the new donation is greater than the previous one', function () {
const secondDonation = 3;
-
describe('when the given R value are invalid', function () {
const R = 256;
const G = 5;
@@ -202,7 +199,6 @@ function shouldBehaveLikeBasil(ContractKlazz, [_, proxyOwner, owner, aWallet, so
});
describe('withdraw', function () {
-
describe('when the sender is not the owner', function () {
const from = anotherone;
const wallet = aWallet;
@@ -260,5 +256,3 @@ function shouldBehaveLikeBasil(ContractKlazz, [_, proxyOwner, owner, aWallet, so
}
module.exports = shouldBehaveLikeBasil;
-
-
diff --git a/test/BasilERC721.test.js b/test/BasilERC721.test.js
index 1d0b696..0eda71f 100644
--- a/test/BasilERC721.test.js
+++ b/test/BasilERC721.test.js
@@ -1,26 +1,23 @@
-"use strict";
-
-const ERC721Token = artifacts.require('ERC721Token');
-const BasilERC721 = artifacts.require('BasilERC721');
+'use strict';
import Deployer from 'kernel/deploy/objects/Deployer';
import shouldBehaveLikeBasil from './Basil.test';
-const ZOS_ADDRESS = "0x212fbf392206bca0a478b9ed3253b08559b35903";
+const ERC721Token = artifacts.require('ERC721Token');
+const BasilERC721 = artifacts.require('BasilERC721');
+
+const ZOS_ADDRESS = '0x212fbf392206bca0a478b9ed3253b08559b35903';
const ZEPPELIN_VERSION = '1.8.0';
const ZEPPELIN_DISTRO = 'ZeppelinOS';
const ERC721_NAME = 'ERC721Token';
contract('BasilERC721', (accounts) => {
-
const owner = accounts[2];
- describe.only('implementation', function() {
-
+ describe.only('implementation', function () {
shouldBehaveLikeBasil(BasilERC721, accounts);
beforeEach(async function () {
-
// Deploy BasilERC721 implementation.
this.basil = await BasilERC721.new();
await this.basil.initialize(owner);
@@ -40,7 +37,7 @@ contract('BasilERC721', (accounts) => {
await this.basil.setToken(erc721Proxy.address);
});
- it('should properly have its ERC721Token set', async function() {
+ it('should properly have its ERC721Token set', async function () {
const token = await this.basil.token();
assert.notEqual(token, 0x0);
});
diff --git a/test/ZOS.test.js b/test/ZOS.test.js
index e474eb1..97dbabb 100644
--- a/test/ZOS.test.js
+++ b/test/ZOS.test.js
@@ -4,18 +4,15 @@ import Deployer from 'kernel/deploy/objects/Deployer';
const Basil = artifacts.require('Basil');
const BasilTestUpgrade = artifacts.require('BasilTestUpgrade.sol');
-const ProjectController = artifacts.require('zos-core/contracts/ProjectController');
-const OwnedUpgradeabilityProxy = artifacts.require("zos-core/contracts/upgradeability/OwnedUpgradeabilityProxy.sol");
+const OwnedUpgradeabilityProxy = artifacts.require('zos-core/contracts/upgradeability/OwnedUpgradeabilityProxy.sol');
const ZepCore = artifacts.require('kernel/contracts/ZepCore.sol');
-const ZOS_ADDRESS = "0x212fbf392206bca0a478b9ed3253b08559b35903";
+const ZOS_ADDRESS = '0x212fbf392206bca0a478b9ed3253b08559b35903';
const ZEPPELIN_VERSION = '1.8.0';
const ZEPPELIN_DISTRO = 'ZeppelinOS';
contract('ZOS', ([_, proxyOwner, owner, aWallet, someone, anotherone]) => {
-
- describe('ProjectController', function() {
-
+ describe('ProjectController', function () {
const projectName = 'TheBasilProject';
const contractName = 'Basil';
@@ -23,46 +20,43 @@ contract('ZOS', ([_, proxyOwner, owner, aWallet, someone, anotherone]) => {
this.controller = await Deployer.projectController(proxyOwner, projectName, ZOS_ADDRESS);
});
- describe('controller', function() {
-
- it('has a valid fallback provider set', async function() {
+ describe('controller', function () {
+ it('has a valid fallback provider set', async function () {
const provider = await this.controller.fallbackProvider();
assert.equal(provider, ZOS_ADDRESS);
});
});
- describe('ZepCore', function() {
-
- it('has an implementation for ERC721Token', async function() {
+ describe('ZepCore', function () {
+ it('has an implementation for ERC721Token', async function () {
const core = ZepCore.at(ZOS_ADDRESS);
const impl = await core.getImplementation(ZEPPELIN_DISTRO, ZEPPELIN_VERSION, 'ERC721Token');
assert.notEqual(impl, 0x0);
});
});
- describe('registry', function() {
-
- it('can add implementation 0', async function() {
+ describe('registry', function () {
+ it('can add implementation 0', async function () {
this.basilImplementation0 = await Deployer.deployAndRegister(this.controller, Basil, contractName, '0');
});
- it('can add implementation 1', async function() {
- this.basilImplementation1 = await Deployer.deployAndRegister(this.controller, BasilTestUpgrade, contractName, '1');
+ it('can add implementation 1', async function () {
+ this.basilImplementation1 = await Deployer.deployAndRegister(
+ this.controller, BasilTestUpgrade, contractName, '1');
});
- describe('controller with registered implementations', function() {
-
- it('knows of implementation 0', async function() {
+ describe('controller with registered implementations', function () {
+ it('knows of implementation 0', async function () {
const controllerImplementation = await this.controller.getImplementation(projectName, '0', contractName);
assert.equal(controllerImplementation, this.basilImplementation0.address);
});
- it('knows of implementation 1', async function() {
+ it('knows of implementation 1', async function () {
const controllerImplementation = await this.controller.getImplementation(projectName, '1', contractName);
assert.equal(controllerImplementation, this.basilImplementation1.address);
});
- it('can create a proxy for implementation 0', async function() {
+ it('can create a proxy for implementation 0', async function () {
this.basilProxy = await Deployer.createProxyAndCall(
this.controller,
proxyOwner,
@@ -75,15 +69,16 @@ contract('ZOS', ([_, proxyOwner, owner, aWallet, someone, anotherone]) => {
);
});
- it('can upgrade the proxy to implementation 1', async function() {
- await this.controller.upgradeTo(this.basilProxy.address, projectName, '1', contractName, {from: proxyOwner});
+ it('can upgrade the proxy to implementation 1', async function () {
+ await this.controller.upgradeTo(
+ this.basilProxy.address, projectName, '1', contractName, { from: proxyOwner });
const proxy = OwnedUpgradeabilityProxy.at(this.basilProxy.address);
assert.equal(await proxy.implementation(), this.basilImplementation1.address);
- const basil_v1 = await BasilTestUpgrade.at(this.basilProxy.address);
- const msg = await basil_v1.sayHi();
- assert.equal(msg, "Hi!");
+ const basilV1 = await BasilTestUpgrade.at(this.basilProxy.address);
+ const msg = await basilV1.sayHi();
+ assert.equal(msg, 'Hi!');
});
});
});
- })
-})
+ });
+});
diff --git a/truffle.js b/truffle.js
index 2a130c8..1fad236 100644
--- a/truffle.js
+++ b/truffle.js
@@ -4,16 +4,16 @@ require('babel-polyfill');
module.exports = {
networks: {
development: {
- name: "development",
+ name: 'development',
host: 'localhost',
port: 8545,
- network_id: '*',
+ network_id: '*', // eslint-disable-line camelcase
},
ropsten: {
- name: "ropsten",
+ name: 'ropsten',
host: 'localhost',
port: 8545,
- network_id: 3,
- }
- }
+ network_id: 3, // eslint-disable-line camelcase
+ },
+ },
};
diff --git a/webpack.common.js b/webpack.common.js
index 740508f..1cc6a8e 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -8,43 +8,43 @@ const config = {
output: {
publicPath: '/',
filename: '[name].[hash].js',
- path: path.join(__dirname, '/dist')
+ path: path.join(__dirname, '/dist'),
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
- use: 'babel-loader'
+ use: 'babel-loader',
},
{
test: /\.(scss|css)/,
- use: [ 'style-loader', 'css-loader', 'sass-loader' ]
+ use: [ 'style-loader', 'css-loader', 'sass-loader' ],
},
{
test: /\.json$/,
- use: 'json-loader'
+ use: 'json-loader',
},
{
test: /\.(ico|jpg|jpeg|png)$/,
- loader: 'file-loader?name=images/[name].[ext]'
+ loader: 'file-loader?name=images/[name].[ext]',
},
{
test: /\.(woff|woff2|eot|ttf)$/,
- loader: 'file-loader?name=fonts/[name].[ext]'
+ loader: 'file-loader?name=fonts/[name].[ext]',
},
- ]
+ ],
},
plugins: [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({ template: './src/index.template.ejs', inject: 'body', title: 'Zeppelin Basil' }),
new webpack.optimize.CommonsChunkPlugin({ name: 'bundle' }),
- new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.$': 'jquery', 'window.jQuery': 'jquery',}),
+ new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.$': 'jquery', 'window.jQuery': 'jquery' }),
],
node: {
fs: 'empty',
net: 'empty',
- tls: 'empty'
+ tls: 'empty',
},
};
diff --git a/webpack.dev.js b/webpack.dev.js
index 26aac07..2e25bc3 100644
--- a/webpack.dev.js
+++ b/webpack.dev.js
@@ -6,21 +6,21 @@ const common = require('./webpack.common.js');
const config = merge(common, {
devtool: 'inline-source-map',
devServer: {
- contentBase: path.join(__dirname, "/dist"),
+ contentBase: path.join(__dirname, '/dist'),
compress: true,
port: 3000,
- host: "0.0.0.0",
+ host: '0.0.0.0',
historyApiFallback: {
- index: './index.html'
- }
+ index: './index.html',
+ },
},
plugins: [
new Dotenv({
- path: './.env.development'
- })
+ path: './.env.development',
+ }),
],
watchOptions: {
- poll: 1000
+ poll: 1000,
},
});
diff --git a/webpack.prod.js b/webpack.prod.js
index 4121b02..2e68c5c 100644
--- a/webpack.prod.js
+++ b/webpack.prod.js
@@ -8,14 +8,14 @@ const config = merge(common, {
plugins: [
new UglifyJSPlugin(),
new Dotenv({
- path: './.env.production'
+ path: './.env.production',
}),
new webpack.DefinePlugin({
'process.env': {
- 'NODE_ENV': JSON.stringify('production')
- }
- })
- ]
+ 'NODE_ENV': JSON.stringify('production'),
+ },
+ }),
+ ],
});
module.exports = config;