diff --git a/web/src/js/app.js b/web/src/js/app.js index 8bc5ffcd..81888f5c 100644 --- a/web/src/js/app.js +++ b/web/src/js/app.js @@ -13,3 +13,5 @@ import "./modules/courses"; import "./modules/comments"; import "./modules/password-show"; import "./modules/profile"; + +import "../sass/app.sass"; diff --git a/web/src/sass/helpers/_mixins.sass b/web/src/sass/helpers/_mixins.sass index 44776d49..ca42a094 100755 --- a/web/src/sass/helpers/_mixins.sass +++ b/web/src/sass/helpers/_mixins.sass @@ -87,7 +87,7 @@ =font($alias, $name) @font-face font-family: $alias - src: url("fonts/" + $name + ".woff2") format("woff2"), url("fonts/" + $name + ".woff") format("woff") + src: url("../fonts/" + $name + ".woff2") format("woff2"), url("../fonts/" + $name + ".woff") format("woff") font-weight: normal font-style: normal // to use: diff --git a/web/webpack.config.js b/web/webpack.config.js index c118b41e..00da7261 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -1,6 +1,7 @@ const webpack = require('webpack'); const path = require('path'); const NODE_ENV = process.env.NODE_ENV || 'development'; +const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: { @@ -8,9 +9,10 @@ module.exports = { courseRedactor: "./src/js/course-redactor.js" }, output: { - path: path.join(__dirname, "build/js"), + path: path.join(__dirname, "build"), filename: NODE_ENV === 'development' ? '[name].js' : '[name].[id].[chunkhash].js', - library: '[name]' + library: '[name]', + publicPath: '/static/', }, module: { loaders: [ @@ -32,7 +34,17 @@ module.exports = { }, { test: /\.css$/, - loader: 'style-loader!css-loader' + use: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: ['css-loader'] + }) + }, + { + test: /\.s[ac]ss$/, + use: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: ['css-loader', 'sass-loader'] + }) }, { test: /\.vue$/, @@ -47,7 +59,7 @@ module.exports = { } }, { - test: /\.(png|gif|woff|woff2|eot|ttf|svg)$/, + test: /\.(png|gif|jpg|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' } ] @@ -63,6 +75,7 @@ module.exports = { jQuery: "jquery", "window.jQuery": "jquery" }), + new ExtractTextPlugin('[name].css'), ], resolve: {