1.2.1 • Published 3 years ago

assets-upload-loader v1.2.1

Weekly downloads
3
License
MIT
Repository
-
Last release
3 years ago

assets-upload-loader

A loader for webpack which upload files to server.

Getting Started

To begin, you'll need to install assets-upload-loader:

$ npm install assets-upload-loader --save-dev

OR

yarn add -D assets-upload-loader

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.(png|jpg|gif)$/i,
        use: [
          {
            loader: 'assets-upload-loader',
            options: {
              upload: {
                url: 'https://example.com/upload',
                data: {
                  token: 'upload token',
                  to: 'to_dir',
                },
              },
              name: 'assets/[name].[hash:6].[ext]',
            },
          },
        ],
      },
    ],
  },
};

And run webpack via your preferred method.

1.2.1

3 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago