Skip to content

Commit

Permalink
support importing almost all image types
Browse files Browse the repository at this point in the history
  • Loading branch information
arefaslani committed Feb 13, 2018
1 parent f49092e commit 16d841b
Showing 1 changed file with 41 additions and 24 deletions.
65 changes: 41 additions & 24 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,49 @@ module.exports = {
})
);

conf.module.rules.push({
test: /\.(sc|c)ss$/,
use: [
{
loader: "emit-file-loader",
options: {
name: "dist/[path][name].[ext].js"
conf.module.rules.push(
{
test: /\.(sc|c)ss$/,
use: [
{
loader: "emit-file-loader",
options: {
name: "dist/[path][name].[ext].js"
}
},
{
loader: "babel-loader",
options: {
babelrc: false,
extends: path.resolve(__dirname, "./.babelrc")
}
},
"styled-jsx-css-loader",
{ loader: "postcss-loader", options: { sourceMap: dev } },
{
loader: "sass-loader",
options: {
sourceMap: dev
}
}
},
{
loader: "babel-loader",
options: {
babelrc: false,
extends: path.resolve(__dirname, "./.babelrc")
]
},
{
test: /\.(jpe?g|png|svg|gif)$/,
use: [
{
loader: "url-loader",
options: {
limit: 8192,
fallback: "file-loader",
publicPath: "/_next/",
outputPath: "static/images/",
name: "[name]-[hash].[ext]"
}
}
},
"styled-jsx-css-loader",
{ loader: "postcss-loader", options: { sourceMap: dev } },
{
loader: "sass-loader",
options: {
sourceMap: dev
}
}
]
});
]
}
);

return conf;
}
Expand Down

0 comments on commit 16d841b

Please sign in to comment.