Skip to content

Commit

Permalink
Merge pull request #8 from rollup-umd/dev
Browse files Browse the repository at this point in the history
fix(createConfig): create config
  • Loading branch information
kopax authored Dec 9, 2018
2 parents 36e55ff + d56b614 commit 76cd99c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"exports-loader": "^0.7.0",
"istanbul-api": "1.2.2",
"istanbul-reports": "1.1.4",
"jest-cli": "^22.4.2",
Expand All @@ -221,6 +220,8 @@
"lodash.omit": "^4.5.0",
"mini-html-webpack-plugin": "^0.2.3",
"parse-author": "^2.0.0",
"exports-loader": "^0.7.0",
"image-webpack-loader": "^4.6.0",
"prop-types": "^15.6.2",
"react": "^16.6.3",
"react-dom": "^16.6.3",
Expand Down
43 changes: 43 additions & 0 deletions src/createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,49 @@ export function createConfig(config = {}, options = {}) {
},
}],
},
{
test: /\.(jpe?g|png|gif)$/,
use: [
{
loader: 'url-loader',
options: {
// Inline files smaller than 10 kB
limit: 10 * 1024,
},
},
{
loader: 'image-webpack-loader',
options: {
mozjpeg: {
enabled: false,
// NOTE: mozjpeg is disabled as it causes errors in some Linux environments
// Try enabling it in your environment by switching the config to:
// enabled: true,
// progressive: true,
},
gifsicle: {
interlaced: false,
},
optipng: {
optimizationLevel: 7,
},
pngquant: {
quality: '65-90',
speed: 4,
},
},
},
],
},
{
test: /\.(mp4|webm)$/,
use: {
loader: 'url-loader',
options: {
limit: 10000,
},
},
},
],
},
}, finalWebpackConfig || {}, userWebpackConfig || {});
Expand Down

0 comments on commit 76cd99c

Please sign in to comment.