Skip to content

Instantly share code, notes, and snippets.

@bitttttten
Created November 14, 2016 13:49
Show Gist options
  • Select an option

  • Save bitttttten/198ed5e1445fcc2f3d9a8d5cb9445328 to your computer and use it in GitHub Desktop.

Select an option

Save bitttttten/198ed5e1445fcc2f3d9a8d5cb9445328 to your computer and use it in GitHub Desktop.
webpack loaders. because you only want to write this -once-
module.exports = [
{
test: /\.jsx?$/,
loader: 'babel',
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
{
test: /\.json$/,
loader: 'json-loader',
},
{
test: /\.sass/,
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded&indentedSyntax',
},
{
test: /\.scss/,
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded',
},
{
test: /\.less/,
loader: 'style-loader!css-loader!less-loader',
},
{
test: /\.styl/,
loader: 'style-loader!css-loader!stylus-loader',
},
{
test: /\.(png|jpg|gif|woff|woff2)$/,
loader: 'url-loader?limit=8192',
},
{
test: /\.(mp4|ogg|svg)$/,
loader: 'file-loader',
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment