Skip to content
This repository has been archived by the owner on Jan 19, 2018. It is now read-only.

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Aug 3, 2017
1 parent 801cea2 commit 3454d7d
Show file tree
Hide file tree
Showing 21 changed files with 60 additions and 40 deletions.
2 changes: 2 additions & 0 deletions dist.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist.js.map

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion dist/bundle.js

This file was deleted.

4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
color: #999;
}
</style>
</head>
<link href="dist/../dist.css" rel="stylesheet"></head>
<body>
<div id="container">
<div class="loading">Loading</div>
</div>
<script src="/parity-utils/inject.js"></script>
<script type="text/javascript" src="dist/bundle.js"></script></body>
<script type="text/javascript" src="dist/../dist.js"></script></body>
</html>
89 changes: 52 additions & 37 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HappyPack = require('happypack');
const webpack = require('webpack');

const isProd = process.env.NODE_ENV === 'production';

module.exports = {
devtool: isProd
? '#hidden-source-map'
: '#source-map',
devtool: '#source-map',
context: path.join(__dirname, 'src'),
entry: {
bundle: './index.js'
dist: './index.js'
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
publicPath: 'dist/',
filename: '../dist.js'
},

module: {
Expand Down Expand Up @@ -71,45 +71,56 @@ module.exports = {
{
test: /\.css$/,
include: /semantic-ui-css/,
use: ['style-loader', 'css-loader']
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
minimize: true
}
}
]
})
},
{
test: /\.css$/,
exclude: /semantic-ui-css/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1,
localIdentName: '[name]_[local]_[hash:base64:10]',
minimize: true,
modules: true
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
importLoaders: 1,
localIdentName: '[name]_[local]_[hash:base64:10]',
minimize: true,
modules: true
}
},
{
loader: 'postcss-loader',
options: {
plugins: (loader) => [
require('postcss-import'),
require('postcss-nested'),
require('postcss-simple-vars')
]
}
}
},
{
loader: 'postcss-loader',
options: {
plugins: (loader) => [
require('postcss-import'),
require('postcss-nested'),
require('postcss-simple-vars')
]
}
}
]
},
{
test: /\.(png|jpg)$/,
use: ['base64-inline-loader']
},
{
test: /\.(woff|woff2|ttf|eot|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: ['base64-inline-loader']
})
},
{
test: /\.svg$/,
use: ['svg-inline-loader']
test: /\.(png|jpg|svg|woff|woff2|ttf|eot|otf)(\?.*)?$/,
use: {
loader: 'file-loader',
options: {
name: '[name].[hash:10].[ext]',
outputPath: '',
useRelativePath: false
}
}
}
],
noParse: [
Expand All @@ -128,6 +139,9 @@ module.exports = {
fs: 'empty'
},
plugins: [
new ExtractTextPlugin({
filename: '../dist.css'
}),
new HappyPack({
id: 'babel',
threads: 4,
Expand All @@ -136,10 +150,11 @@ module.exports = {
new HtmlWebpackPlugin({
filename: '../index.html',
template: './index.ejs',
chunks: ['bundle']
chunks: ['dist']
}),
isProd && new webpack.optimize.UglifyJsPlugin({
screwIe8: true,
sourceMap: true,
compress: {
warnings: false
},
Expand Down

0 comments on commit 3454d7d

Please sign in to comment.