Skip to content

Commit

Permalink
refactor: FetchStickerDataPlugin caches sticker data.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobits committed Jan 16, 2020
1 parent 57c1a27 commit 68aa695
Show file tree
Hide file tree
Showing 20 changed files with 779 additions and 393 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -87,10 +87,11 @@ typings/
# next.js build output
.next

# Build artifacts
# Build artifacts.
/dist

# Linaria's cache directory.
/.linaria-cache

/NOTES.md
# Cache directory for FetchStickerDataPlugin.
/.sticker-pack-cache
10 changes: 6 additions & 4 deletions config/webpack.config.ts
Expand Up @@ -105,9 +105,9 @@ export default (env: string, argv: any): webpack.Configuration => {
}]
});

// Text & Protobuf files.
// Text files.
config.module.rules.push({
test: /\.(txt|proto)$/,
test: /\.txt$/,
use: [{
loader: 'raw-loader'
}]
Expand Down Expand Up @@ -212,9 +212,11 @@ export default (env: string, argv: any): webpack.Configuration => {
}

config.plugins.push(new FetchStickerDataPlugin({
filename: 'stickerData.json'
inputFile: path.resolve(PKG_ROOT, 'stickers.yml'),
outputFile: 'stickerData.json'
}));


// ----- Dev Server ----------------------------------------------------------

if (argv.mode === 'development') {
Expand Down Expand Up @@ -256,7 +258,7 @@ export default (env: string, argv: any): webpack.Configuration => {
minChunks: 1
},
data: {
test: /src\/.(json|proto)$/,
test: /src\/.json$/,
name: 'data',
chunks: 'all',
minChunks: 1
Expand Down

0 comments on commit 68aa695

Please sign in to comment.