Merge pull request #11 from MarcoGlauser/master
update webpack config to work with current dependencies
This commit is contained in:
commit
6c1e480753
1 changed files with 23 additions and 19 deletions
|
@ -35,16 +35,17 @@ if ( isProduction ) {
|
||||||
css: [
|
css: [
|
||||||
'./node_modules/tailwindcss/dist/base.css'
|
'./node_modules/tailwindcss/dist/base.css'
|
||||||
],
|
],
|
||||||
extractors: [
|
// Use Extractor configuration from Tailwind Docs
|
||||||
{
|
// https://tailwindcss.com/docs/controlling-file-size#setting-up-purge-css-manually
|
||||||
extractor: class TailwindExtractor {
|
defaultExtractor: content => {
|
||||||
static extract(content) {
|
// Capture as liberally as possible, including things like `h-(screen-1.5)`
|
||||||
return content.match(/[A-Za-z0-9-_:\/]+/g) || [];
|
const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || []
|
||||||
}
|
|
||||||
},
|
// Capture classes within other delimiters like .block(class="w-1/2") in Pug
|
||||||
extensions: ['php', 'js', 'svg', 'css',]
|
const innerMatches = content.match(/[^<>"'`\s.()]*[^<>"'`\s.():]/g) || []
|
||||||
}
|
|
||||||
],
|
return broadMatches.concat(innerMatches)
|
||||||
|
},
|
||||||
whitelistPatterns: getCSSWhitelistPatterns()
|
whitelistPatterns: getCSSWhitelistPatterns()
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -87,7 +88,6 @@ const config = {
|
||||||
loader: 'css-loader',
|
loader: 'css-loader',
|
||||||
options: {
|
options: {
|
||||||
importLoaders: 1,
|
importLoaders: 1,
|
||||||
context: 'postcss',
|
|
||||||
sourceMap: ! isProduction
|
sourceMap: ! isProduction
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -113,13 +113,17 @@ const config = {
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
filename: `[name]${prefix}.css`,
|
filename: `[name]${prefix}.css`,
|
||||||
}),
|
}),
|
||||||
new CopyWebpackPlugin([{
|
new CopyWebpackPlugin({
|
||||||
from: './assets/images/',
|
patterns: [{
|
||||||
to: 'images',
|
from: './assets/images/',
|
||||||
ignore: [
|
to: 'images',
|
||||||
'.DS_Store'
|
globOptions: {
|
||||||
]
|
ignore: [
|
||||||
}]),
|
'**/.DS_Store'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}),
|
||||||
new ImageminPlugin({ test: /\.(jpe?g|png|gif|svg)$/i })
|
new ImageminPlugin({ test: /\.(jpe?g|png|gif|svg)$/i })
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue