Skip to content

Commit

Permalink
fix: fix svg loader when importing from javascript
Browse files Browse the repository at this point in the history
affects: neutrino-preset-tux

See upstream issue: neutrinojs/neutrino#272

ISSUES CLOSED: #144
  • Loading branch information
eirikurn committed Sep 13, 2017
1 parent 0ab76fc commit 4f85276
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/neutrino-preset-tux/src/index.ts
Expand Up @@ -51,17 +51,32 @@ export default (neutrino: Neutrino, opts: Partial<Options> = {}) => {

// prettier-ignore
neutrino.config
// Neutrino defaults to relative paths './'. Tux is optimized for SPAs, where apsolute paths
// Neutrino defaults to relative paths './'. Tux is optimized for SPAs, where absolute paths
// are a better default.
.output
.publicPath('/')
.end()

// Fix svg imports: https://github.com/mozilla-neutrino/neutrino-dev/issues/272
.module
.rule('svg')
.use('url')
.loader(require.resolve('file-loader'))
.options({ limit: 8192 })
.end()
.end()
.end()

// Use a better open utility.
.when(options.devServer.open, () => neutrino.use(betterOpen, options))

// Extract and minify css in production.
.when(isProd, () => {
neutrino.use(extractStyle)
neutrino.use(minifyStyle)
})

// Add goodies from create-react-app project.
.when(!isProd, () => {
neutrino.use(betterDev, options)
})
Expand Down

0 comments on commit 4f85276

Please sign in to comment.