Skip to content

Commit

Permalink
feat: 🎸 Added asset loader
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimck committed Sep 5, 2021
1 parent 2be3e3d commit 7553bc3
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 149 deletions.
2 changes: 2 additions & 0 deletions packages/cli/default.ima.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ module.exports = {
publicPath: '', // Webpack assets public path
compress: process.env.NODE_ENV === 'production', // Enable gzip compression for assets
scrambleCss: process.env.NODE_ENV === 'production', // Enables CSS scrambling (for AMP too)
imageInlineSizeLimit: 8192, // Threshold to inline image resources as base64 automatically
webpackAliases: {}, // Optional custom webpack aliases

// Settings related to AMP-specific css files generation
amp: {
Expand Down
28 changes: 26 additions & 2 deletions packages/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"postcss-pipeline-webpack-plugin": "^6.0.0",
"postcss-preset-env": "^6.7.0",
"react-refresh": "^0.10.0",
"source-map-loader": "^3.0.0",
"webpack": "^5.38.1",
"webpack-dev-middleware": "^5.0.0",
"webpack-hot-middleware": "^2.25.0",
Expand Down
13 changes: 3 additions & 10 deletions packages/cli/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ echo " Copying @ima/server, @ima/cli & @ima/core to app directory..."
echo "===-----------------------------------------------------------==="
echo ""

echo 'Unlinking @ima/cli'
cd $APP_DIR
npm unlink @ima/cli

echo 'Syncing @ima/core...'
cd $APP_DIR/node_modules/@ima/core
ls -1 | grep -v 'node_modules' | xargs rm -rf
rm -rf $APP_DIR/node_modules/@ima/core
rsync -aq --progress $CLI_DIR/../core $APP_DIR/node_modules/@ima --exclude node_modules

echo 'Syncing @ima/server...'
cd $APP_DIR/node_modules/@ima/server
ls -1 | grep -v 'node_modules' | xargs rm -rf
rm -rf $APP_DIR/node_modules/@ima/server
rsync -aq --progress $CLI_DIR/../server $APP_DIR/node_modules/@ima --exclude node_modules

echo 'Syncing @ima/cli...'
cd $APP_DIR/node_modules/@ima/cli
ls -1 | grep -v 'node_modules' | xargs rm -rf
rm -rf $APP_DIR/node_modules/@ima/cli
rsync -aq --progress $CLI_DIR $APP_DIR/node_modules/@ima --exclude node_modules
Loading

0 comments on commit 7553bc3

Please sign in to comment.