From 4315f3b4a11985293e18b24116159dafb97bcca3 Mon Sep 17 00:00:00 2001 From: Luke Sanwick Date: Sat, 11 Jun 2016 06:46:26 -0700 Subject: [PATCH] feat(loaders): Include CSS and image loaders in the webpack config (#47) --- package.json | 8 +++++++- src/configure-webpack.js | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3aa08ad..d0f5d10 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "ava": "^0.15.2", "babel-cli": "^6.10.1", "babel-eslint": "^6.0.4", + "css-loader": "^0.23.1", "cz-conventional-changelog": "^1.1.6", "del": "^2.2.0", "del-cli": "^0.2.0", @@ -76,8 +77,13 @@ "eslint-plugin-babel": "^3.2.0", "eslint-plugin-import": "^1.8.1", "eventsource": "^0.2.1", + "file-loader": "^0.8.5", "mkdirp": "^0.5.1", - "semantic-release": "^4.3.5" + "node-sass": "^3.7.0", + "sass-loader": "^3.2.0", + "semantic-release": "^4.3.5", + "style-loader": "^0.13.1", + "url-loader": "^0.5.7" }, "ava": { "babel": "inherit" diff --git a/src/configure-webpack.js b/src/configure-webpack.js index 421b7e4..2469723 100644 --- a/src/configure-webpack.js +++ b/src/configure-webpack.js @@ -40,10 +40,11 @@ export default (options) => ({ exclude: /node_modules/, loader: 'babel-loader?' + JSON.stringify(babelrc), }, - { - test: /\.json$/, - loader: 'json-loader', - }, + { test: /\.json$/, loader: 'json' }, + { test: /\.css$/, loaders: [ 'style', 'css' ] }, + { test: /\.sass$/, loaders: [ 'style', 'css', 'sass?indentedSyntax' ] }, + { test: /\.scss$/, loaders: [ 'style', 'css', 'sass' ] }, + { test: /\.(gif|jpg|png)$/, loader: 'url?limit=25000' }, ] },