Last active
February 18, 2016 05:40
-
-
Save jjasonclark/45f4ac39b255f68eb09f to your computer and use it in GitHub Desktop.
Failing to include scss imports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js'); | |
var ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
var extractCSS = new ExtractTextPlugin("css/[name].css"); | |
var extractSCSS = new ExtractTextPlugin("css/[name].scss"); | |
module.exports = { | |
context: __dirname + '/assets', | |
entry: { | |
angular: './js/angular.js', | |
bootstrap: './js/bootstrap.js', | |
login: './js/login.js', | |
index: './js/index.js', | |
}, | |
output: { | |
path: __dirname + '/build/public', | |
publicPath: "/", | |
filename: './js/[name].js' | |
}, | |
module: { | |
loader: [ | |
{ test: /\.js$/, loaders: ['ng-annotate'] }, | |
{ test: /\.nghtml$/, loader: ["ngtemplate?relativeTo=" + path.resolve(__dirname, './assets'), "raw"] }, | |
{ test: /\.html$/, loader: ["html", "raw"] }, | |
{ test: /\.css$/, loader: extractCSS.extract('style', 'css') }, | |
{ test: /\.s[ac]ss$/, loaders: extractSCSS.extract('style', 'css', 'sass') }, | |
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" }, | |
{ test: /\.(woff|woff2)$/, loader:"url?prefix=font/&limit=5000" }, | |
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" }, | |
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }, | |
{ test: /\.(png|jpg)$/, loader: 'url?limit=8192' } | |
] | |
}, | |
sassLoader: { | |
includePaths: [path.resolve(__dirname, "./assets/css")], | |
}, | |
ngtemplateLoader: { | |
relativeTo: [path.resolve(__dirname, './assets')], | |
}, | |
resolve: { | |
extensions: ['', '.js', '.scss', '.css', '.nghtml', '.html'], | |
}, | |
node: { | |
fs: "empty", | |
fsevents: "empty" | |
}, | |
plugins: [commonsPlugin, extractCSS, extractSCSS] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment