0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Vue.jsで作ったSPAをAmazon S3で公開するのだが、とにかくcssとjsを階層構造なく平らに置きたいんだ

Posted at

独り言の作業記録ログです。

0.本日のゴール

vuejsで作ったSPA。
Amazon S3で公開するのだが、CSSやJSを階層構造なくフラットに配置したい。

1.それ、vue.config.jsでビルド時の出力先をカスタマイズできるよ

vue.config.js

module.exports = {
    devServer: {
        port: 3000,
        disableHostCheck: true,
    },
    configureWebpack: {
        output: {
            filename: '[name].js',
        },
    },
    css: {
        extract: {
            filename: '[name].css',
            chunkFilename: '[name].css',
        },
    },
    outputDir: 'dist',
    chainWebpack: config => {
        config.output
            .filename('[name].js')
            .chunkFilename('[name].js');

        config.module
            .rule('images')
            .use('file-loader')
            .loader('file-loader')
            .tap(options => {
                options = options || {};
                options.name = '[name].[ext]';
                return options;
            });
    }
};

瞬殺だった・・・。

(fin)

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?