{"id":918,"date":"2015-05-07T14:49:43","date_gmt":"2015-05-07T05:49:43","guid":{"rendered":"https:\/\/blog.ymyzk.com\/?p=918"},"modified":"2015-05-07T14:49:43","modified_gmt":"2015-05-07T05:49:43","slug":"django-compressor-babel-ecmascript-6","status":"publish","type":"post","link":"https:\/\/blog.ymyzk.com\/2015\/05\/django-compressor-babel-ecmascript-6\/","title":{"rendered":"Django Compressor + Babel \u3067 Django \u3067\u3082\u7c21\u5358\u306b ES6 \u30b3\u30fc\u30c9\u3092\u6271\u3046\u65b9\u6cd5"},"content":{"rendered":"
ECMAScript 6 \u306e\u5b9f\u88c5\u306f\u5404\u51e6\u7406\u7cfb\u3067\u5c11\u3057\u305a\u3064\u9032\u3093\u3067\u3044\u307e\u3059\u304c, \u73fe\u5b9f\u7684\u306b Web \u30d6\u30e9\u30a6\u30b6\u3067 ECMAScript 6 \u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u4e00\u90e8\u306e\u6a5f\u80fd\u306e\u307f\u3092\u7528\u3044\u308b\u304b, Babel<\/a> \u7b49\u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u3092\u7528\u3044\u3066 ECMAScript 5 \u4e92\u63db\u306e\u30b3\u30fc\u30c9\u306b\u5909\u63db\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059.<\/p>\n \u3053\u306e\u8a18\u4e8b\u3067\u306f Python \u306e Web \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af Django \u3068 Django \u3067\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u306e\u5727\u7e2e\u7b49\u3092\u884c\u3046 Django Compressor<\/a> \u3068 Babel \u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059.<\/p>\n <\/p>\n Python\u30fbDjango\u30fbDjango Compressor\u30fbNode.js (io.js)\u30fbBabel \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u74b0\u5883\u304c\u3042\u308a, \u9069\u5f53\u306a Django \u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u751f\u6210\u3067\u304d\u3066\u3044\u308b\u3082\u306e\u3068\u4eee\u5b9a\u3057\u307e\u3059.<\/p>\n Django \u3068 Django Compressor \u306f pip \u3092\u7528\u3044\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb, Babel \u306f npm \u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u304c\u7c21\u5358\u3067\u3059.<\/p>\n Django Compressor \u306e\u8a2d\u5b9a\u3092 Django \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb (\u4f8b: \u74b0\u5883<\/h2>\n
\r\npip install Django django_compressor\r\nnpm install -g babel\r\n<\/pre>\n
\u57fa\u672c\u8a2d\u5b9a<\/h2>\n
settings.py<\/code>) \u306b \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u306b\u5f93\u3063\u3066\u8a18\u8ff0\u3057\u307e\u3059.<\/p>\n
\r\nINSTALLED_APPS = (\r\n # other apps\r\n # INSTALLED_APPS \u306b compressor \u3092\u8ffd\u52a0\u3059\u308b\r\n 'compressor',\r\n)\r\n\r\nSTATICFILES_FINDERS = (\r\n 'django.contrib.staticfiles.finders.FileSystemFinder',\r\n 'django.contrib.staticfiles.finders.AppDirectoriesFinder',\r\n # STATICFILES_FINDERS \u306b compressor.finders.CompressorFinder \u3092\u8ffd\u52a0\u3059\u308b\r\n 'compressor.finders.CompressorFinder',\r\n)\r\n\r\n# STATIC_ROOT \u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f COMPRESS_ROOT \u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059.\r\n<\/pre>\n
Babel \u3092\u7528\u3044\u308b\u8a2d\u5b9a<\/h2>\n