Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<script type="text/javascript" src="https://cdn.trackjs.com/releases/current/tracker.js"></script>
<!-- END TRACKJS -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="styles.css" media="all" />
<link rel="stylesheet" type="text/css" href="vendors.css" media="all" />
</head>
<body>
<div id="content"></div>
Expand Down
30 changes: 21 additions & 9 deletions base.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
const path = require('path');
const webpack = require('webpack');
const fs = require('fs');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const SpritePlugin = require('svg-sprite-loader/plugin');

const extractSass = new ExtractTextPlugin({
filename: 'styles.css',
disable: process.env.NODE_ENV !== 'production',
});

const extractCss = new ExtractTextPlugin({
filename: 'vendors.css',
disable: process.env.NODE_ENV !== 'production',
});

module.exports = {
entry: {
bundle: ['react-hot-loader/patch', './app/scripts/main'],
Expand All @@ -20,13 +31,6 @@ module.exports = {
{
test: /\.jsx?$/,
use: [
// {
// loader: 'transform-loader/cacheable',
//
// options: {
// envify: true,
// },
// },
{loader: 'babel-loader', options: {cacheDirectory: true}},
'if-loader',
],
Expand All @@ -39,12 +43,18 @@ module.exports = {
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
use: extractSass.extract({
use: ['css-loader', 'sass-loader'],
fallback: 'style-loader',
}),
include: [path.join(__dirname, 'app/styles')],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
use: extractCss.extract({
use: 'css-loader',
fallback: 'style-loader',
}),
},
{
test: /\.(jpg|otf)$/,
Expand Down Expand Up @@ -95,6 +105,8 @@ module.exports = {
new webpack.ProvidePlugin({
_: 'lodash',
}),
extractCss,
extractSass,
new SpritePlugin(),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@
"babel-project-relative-import": "^2.0.1",
"base64-loader": "^1.0.0",
"chai": "^3.4.1",
"css-loader": "^0.23.1",
"css-loader": "^0.28.7",
"envify": "^3.4.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^5.0.1",
"extract-text-webpack-plugin": "^2.1.2",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.8.5",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^2.3.1",
Expand Down Expand Up @@ -104,8 +104,8 @@
"react-hot-loader": "next",
"react-storybook-decorator-background": "^1.0.5",
"react-test-renderer": "^15.6.1",
"sass-loader": "^3.1.2",
"style-loader": "^0.13.0",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
"svg-inline-loader": "^0.7.1",
"svg-sprite-loader": "^3.0.2",
"svgo-loader": "^1.2.1",
Expand All @@ -114,7 +114,7 @@
"url-loader": "^0.5.7",
"vatrates": "^1.2.1",
"webpack": "^3.5.4",
"webpack-dev-server": "^2.7.1",
"webpack-dev-server": "^2.8.2",
"webpack-merge": "^4.1.0"
},
"engines": {
Expand Down
8 changes: 0 additions & 8 deletions prod.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path');
const webpack = require('webpack');
const fs = require('fs');
const merge = require('webpack-merge');

const base = require('./base.config');
Expand All @@ -16,13 +15,6 @@ module.exports = merge(base, {
{
test: /\.jsx?$/,
use: [
// {
// loader: 'transform/cacheable-loader',
//
// options: {
// envify: true,
// },
// },
{
loader: 'babel-loader',

Expand Down
Loading