Add moment-locales-webpack-plugin

This commit is contained in:
hina 2020-06-06 06:41:57 +09:00
parent 350360e2a9
commit 2a988275f3
No known key found for this signature in database
GPG Key ID: B666B2A137443F76
5 changed files with 24 additions and 2 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
/public/hot /public/hot
/public/storage /public/storage
/public/mix-manifest.json /public/mix-manifest.json
/public/report.html
/storage/*.key /storage/*.key
/vendor /vendor
/.idea /.idea

View File

@ -23,6 +23,7 @@
"laravel-mix": "^4.0.0", "laravel-mix": "^4.0.0",
"laravel-mix-bundle-analyzer": "^1.0.2", "laravel-mix-bundle-analyzer": "^1.0.2",
"lint-staged": "^8.1.5", "lint-staged": "^8.1.5",
"moment-locales-webpack-plugin": "^1.2.0",
"open-iconic": "^1.1.1", "open-iconic": "^1.1.1",
"popper.js": "^1.14.7", "popper.js": "^1.14.7",
"resolve-url-loader": "^2.3.1", "resolve-url-loader": "^2.3.1",

View File

@ -35,4 +35,4 @@ new Chart(graph.getContext('2d'), {
}] }]
} }
} }
}); });

10
webpack.mix.js vendored
View File

@ -1,5 +1,6 @@
const mix = require('laravel-mix'); const mix = require('laravel-mix');
require('laravel-mix-bundle-analyzer') require('laravel-mix-bundle-analyzer')
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -27,7 +28,14 @@ mix.js('resources/assets/js/app.js', 'public/js')
.extract(['jquery', 'bootstrap']) .extract(['jquery', 'bootstrap'])
.extract(['chart.js', 'chartjs-color', 'color-name', 'moment', 'd3'], 'public/js/vendor/chart') .extract(['chart.js', 'chartjs-color', 'color-name', 'moment', 'd3'], 'public/js/vendor/chart')
.version() .version()
.webpackConfig(webpack => ({
plugins: [
new MomentLocalesPlugin({
localesToKeep: ['ja']
})
]
}));
if (process.argv.includes('-a')) { if (process.argv.includes('-a')) {
mix.bundleAnalyzer({analyzerMode: 'static'}); mix.bundleAnalyzer({ analyzerMode: 'static' });
} }

View File

@ -4589,6 +4589,11 @@ lodash.defaults@^4.0.0:
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=
lodash.difference@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c"
integrity sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=
lodash.isarguments@^3.0.0: lodash.isarguments@^3.0.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
@ -5002,6 +5007,13 @@ mkdirp@^0.5.1, mkdirp@~0.5.1:
dependencies: dependencies:
minimist "0.0.8" minimist "0.0.8"
moment-locales-webpack-plugin@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/moment-locales-webpack-plugin/-/moment-locales-webpack-plugin-1.2.0.tgz#9af83876a44053706b868ceece5119584d10d7aa"
integrity sha512-QAi5v0OlPUP7GXviKMtxnpBAo8WmTHrUNN7iciAhNOEAd9evCOvuN0g1N7ThIg3q11GLCkjY1zQ2saRcf/43nQ==
dependencies:
lodash.difference "^4.5.0"
moment@^2.10.2: moment@^2.10.2:
version "2.24.0" version "2.24.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"