
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
webpack-s3-uploader
Advanced tools
This will upload all compiled assets to AWS S3 bucket during a webpack build process. You can serve all your files via Cloud Front or different CDN.
$ npm i -S webpack-s3-uploader
First set environmental variables:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
// require plugin
var S3Uploader = require('webpack-s3-uploader')
const config = {
context: path.resolve(__dirname, '..'),
output: {
path: path.resolve(__dirname, '../build/public/assets'),
publicPath: 'your_cdn_url',
},
plugins: [
new S3Uploader({
s3Options: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
region: 'us-west-1',
sessionToken: 'asdsaad' // the optional AWS session token to sign requests with
},
s3UploadOptions: {
Bucket: 'MyBucket'
},
})
]
// ..other configuration
}
It is required to set:
output.path
is a path, where all assets will be compiled and those will be uploaded. You can use exclude
and include
option.output.publicPath
it is a path, where all compiled assets will be referenced to. During a compilation process webpack replaces local path with this one. If you have Cloud Front pointed to your S3 bucket, you should put url here.exclude
: A Pattern to match for excluded content (e.g. /.*\.(css|js)/
). Behaves similarly to webpack's loader configuration.include
: A Pattern to match for included content. Behaves the same as the exclude
.s3Options
: Provide keys for upload extention of s3Configs3UploadOptions
: Provide upload options putObjectbasePath
: Provide the namespace where upload files on S3progress
: Enable progress bar (defaults true)include
and exclude rules
include
and exclude
rules behave similarly to Webpack's loader options. In addition to a RegExp you can pass a function which will be called with the path as its first argument. Returning a truthy value will match the rule. You can also pass an Array of rules, all of which must pass for the file to be included or excluded.
Resources that are located outside of the webpack output.path directory are pathed as follows
output.path = /myproject/build/dist/bundle
const ASSET_OUTPUT_PATH =/myproject/build/assets
or
const ASSET_OUTPUT_PATH =../assets
...
rules [
use: [
...,
{
loader: 'file-loader',
options: {
...,
outputPath: ASSET_OUTPUT_PATH
}
}
]
The above configuration will output to the local file system as follows
build
|
----- dest
|
---- bundle.js
|
----- assets
|
---- myasset.png
and will be pathed in S3 as follows
my-bucket
|
---- bundle.js
---- assets
|
---- myasset.png
This is a lite and refactored version of s3-plugin-webpack
FAQs
Uploads compiled assets to s3 during webpack build
The npm package webpack-s3-uploader receives a total of 66 weekly downloads. As such, webpack-s3-uploader popularity was classified as not popular.
We found that webpack-s3-uploader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.