summaryrefslogtreecommitdiff
path: root/config/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack.config.js')
-rw-r--r--config/webpack.config.js36
1 files changed, 35 insertions, 1 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 8e2b11a4145..3ccfbb0dd56 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -5,6 +5,7 @@ var path = require('path');
var webpack = require('webpack');
var StatsPlugin = require('stats-webpack-plugin');
var CompressionPlugin = require('compression-webpack-plugin');
+var ExtractTextPlugin = require("extract-text-webpack-plugin");
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var ROOT_PATH = path.resolve(__dirname, '..');
@@ -68,7 +69,38 @@ var config = {
},
{
test: /\.svg$/,
- use: 'raw-loader'
+ include: /app\/views\/shared\/icons/,
+ use: 'raw-loader',
+ },
+ {
+ test: /\.(eot|ttf|woff2?|svg)(\?\S*)?$/,
+ exclude: /app\/views\/shared\/icons/,
+ use: {
+ loader: 'url-loader',
+ options: {
+ limit: 8000,
+ }
+ }
+ },
+ {
+ test: /\.s?css$/,
+ use: ExtractTextPlugin.extract({
+ fallback: 'style-loader',
+ use: [{
+ loader: 'css-loader',
+ options: {
+ sourceMap: true,
+ }
+ }, {
+ loader: 'sass-loader',
+ options: {
+ includePaths: [
+ path.join(ROOT_PATH, 'app/assets/stylesheets')
+ ],
+ sourceMap: true
+ }
+ }]
+ }),
}
]
},
@@ -98,6 +130,8 @@ var config = {
new webpack.HashedModuleIdsPlugin() :
new webpack.NamedModulesPlugin(),
+ new ExtractTextPlugin('main.css'),
+
// create cacheable common library bundle for all vue chunks
new webpack.optimize.CommonsChunkPlugin({
name: 'common_vue',