Skip to content

Instantly share code, notes, and snippets.

@hrdwdmrbl
Last active June 22, 2020 20:16
Show Gist options
  • Save hrdwdmrbl/fb5c5b9e48186b6e9faecb374322cbd4 to your computer and use it in GitHub Desktop.
Save hrdwdmrbl/fb5c5b9e48186b6e9faecb374322cbd4 to your computer and use it in GitHub Desktop.
Mostly default Rails 6 Webpacker config
{
"loaders": [
{
"key": "file",
"value": {
"test": {},
"use": [
{
"loader": "file-loader",
"options": {
"context": "app/javascript"
}
}
]
}
},
{
"key": "css",
"value": {
"test": {},
"use": [
{
"loader": "style-loader"
},
{
"loader": "css-loader",
"options": {
"sourceMap": true,
"importLoaders": 2,
"modules": false
}
},
{
"loader": "postcss-loader",
"options": {
"config": {
"path": "<YOUR RAILS DIRECTORY>"
},
"sourceMap": true
}
}
],
"sideEffects": true,
"exclude": {}
}
},
{
"key": "sass",
"value": {
"test": {},
"use": [
{
"loader": "style-loader"
},
{
"loader": "css-loader",
"options": {
"sourceMap": true,
"importLoaders": 2,
"modules": false
}
},
{
"loader": "postcss-loader",
"options": {
"config": {
"path": "<YOUR RAILS DIRECTORY>"
},
"sourceMap": true
}
},
{
"loader": "sass-loader",
"options": {
"sourceMap": true
}
}
],
"sideEffects": true,
"exclude": {}
}
},
{
"key": "moduleCss",
"value": {
"test": {},
"use": [
{
"loader": "style-loader"
},
{
"loader": "css-loader",
"options": {
"sourceMap": true,
"importLoaders": 2,
"modules": {
"localIdentName": "[name]__[local]___[hash:base64:5]"
}
}
},
{
"loader": "postcss-loader",
"options": {
"config": {
"path": "<YOUR RAILS DIRECTORY>"
},
"sourceMap": true
}
}
],
"sideEffects": false,
"include": {}
}
},
{
"key": "moduleSass",
"value": {
"test": {},
"use": [
{
"loader": "style-loader"
},
{
"loader": "css-loader",
"options": {
"sourceMap": true,
"importLoaders": 2,
"modules": {
"localIdentName": "[name]__[local]___[hash:base64:5]"
}
}
},
{
"loader": "postcss-loader",
"options": {
"config": {
"path": "<YOUR RAILS DIRECTORY>"
},
"sourceMap": true
}
},
{
"loader": "sass-loader",
"options": {
"sourceMap": true
}
}
],
"sideEffects": false,
"include": {}
}
},
{
"key": "nodeModules",
"value": {
"test": {},
"include": {},
"exclude": {},
"use": [
{
"loader": "babel-loader",
"options": {
"babelrc": false,
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
],
"cacheDirectory": "tmp/cache/webpacker/babel-loader-node-modules",
"cacheCompression": false,
"compact": false,
"sourceMaps": false
}
}
]
}
},
{
"key": "babel",
"value": {
"test": {},
"include": [
"<YOUR RAILS DIRECTORY>/app/javascript",
"<YOUR RAILS DIRECTORY>/vendor/keen/dist",
"<YOUR RAILS DIRECTORY>/app/assets"
],
"exclude": {},
"use": [
{
"loader": "babel-loader",
"options": {
"cacheDirectory": "tmp/cache/webpacker/babel-loader-node-modules",
"cacheCompression": false,
"compact": false
}
}
]
}
}
],
"plugins": [
{
"key": "Environment",
"value": {
"keys": [
"TERM_SESSION_ID",
"SSH_AUTH_SOCK",
"LC_TERMINAL_VERSION",
"COLORFGBG",
"ITERM_PROFILE",
"XPC_FLAGS",
"LANG",
"PWD",
"SHELL",
"SECURITYSESSIONID",
"TERM_PROGRAM_VERSION",
"TERM_PROGRAM",
"PATH",
"DISPLAY",
"LC_TERMINAL",
"COLORTERM",
"COMMAND_MODE",
"TERM",
"HOME",
"TMPDIR",
"USER",
"XPC_SERVICE_NAME",
"LOGNAME",
"LaunchInstanceID",
"__CF_USER_TEXT_ENCODING",
"ITERM_SESSION_ID",
"SHLVL",
"OLDPWD",
"ZSH",
"PAGER",
"LESS",
"LC_CTYPE",
"LSCOLORS",
"NVM_DIR",
"NVM_CD_FLAGS",
"NVM_NODEJS_ORG_MIRROR",
"NVM_IOJS_ORG_MIRROR",
"MANPATH",
"NVM_PATH",
"NVM_BIN",
"rvm_prefix",
"rvm_path",
"rvm_bin_path",
"rvm_version",
"GEM_HOME",
"GEM_PATH",
"MY_RUBY_HOME",
"IRBRC",
"RUBY_VERSION",
"rvm_alias_expanded",
"rvm_bin_flag",
"rvm_delete_flag",
"rvm_docs_type",
"rvm_file_name",
"rvm_gemstone_package_file",
"rvm_gemstone_url",
"rvm_niceness",
"rvm_nightly_flag",
"rvm_only_path_flag",
"rvm_pretty_print_flag",
"rvm_proxy",
"rvm_quiet_flag",
"rvm_ruby_alias",
"rvm_ruby_bits",
"rvm_ruby_file",
"rvm_ruby_make",
"rvm_ruby_make_install",
"rvm_ruby_mode",
"rvm_script_name",
"rvm_sdk",
"rvm_silent_flag",
"rvm_sticky_flag",
"rvm_system_flag",
"rvm_use_flag",
"rvm_user_flag",
"rvm_ruby_string",
"_",
"RAILS_ENV",
"NODE_ENV",
"BUNDLE_GEMFILE",
"BUNDLER_ORIG_BUNDLE_BIN_PATH",
"BUNDLER_ORIG_BUNDLE_GEMFILE",
"BUNDLER_ORIG_BUNDLER_VERSION",
"BUNDLER_ORIG_GEM_HOME",
"BUNDLER_ORIG_GEM_PATH",
"BUNDLER_ORIG_MANPATH",
"BUNDLER_ORIG_PATH",
"BUNDLER_ORIG_RB_USER_INSTALL",
"BUNDLER_ORIG_RUBYLIB",
"BUNDLER_ORIG_RUBYOPT",
"BUNDLE_BIN_PATH",
"BUNDLER_VERSION",
"RUBYOPT",
"RUBYLIB"
],
"defaultValues": {
"TERM_SESSION_ID": "w0t4p2:9E5166B6-8AD5-4F4E-A283-61946CC0D467",
"SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.JsmU1sellz/Listeners",
"LC_TERMINAL_VERSION": "3.3.9",
"COLORFGBG": "15;0",
"ITERM_PROFILE": "Default",
"XPC_FLAGS": "0x0",
"LANG": "en_CA.UTF-8",
"PWD": "<YOUR RAILS DIRECTORY>",
"SHELL": "/bin/zsh",
"SECURITYSESSIONID": "18703",
"TERM_PROGRAM_VERSION": "3.3.9",
"TERM_PROGRAM": "iTerm.app",
"PATH": "~/.rvm/gems/ruby-2.6.5/bin:~/.rvm/gems/ruby-2.6.5@global/bin:~/.rvm/rubies/ruby-2.6.5/bin:~/.rvm/bin:/usr/local/opt/imagemagick@6/bin:~/.nvm/versions/node/v12.13.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands",
"DISPLAY": "/private/tmp/com.apple.launchd.TXisb1nxfN/org.macosforge.xquartz:0",
"LC_TERMINAL": "iTerm2",
"COLORTERM": "truecolor",
"COMMAND_MODE": "unix2003",
"TERM": "xterm-256color",
"HOME": "~",
"TMPDIR": "/var/folders/8d/vtjsmg096nnfqgg9_zr9hz240000gn/T/",
"USER": "X",
"XPC_SERVICE_NAME": "0",
"LOGNAME": "X",
"LaunchInstanceID": "21637BC6-3501-4525-8B49-FE0625B15770",
"__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0x52",
"ITERM_SESSION_ID": "w0t4p2:9E5166B6-8AD5-4F4E-A283-61946CC0D467",
"SHLVL": "1",
"OLDPWD": "<YOUR RAILS DIRECTORY>",
"ZSH": "~/.oh-my-zsh",
"PAGER": "less",
"LESS": "-R",
"LC_CTYPE": "en_CA.UTF-8",
"LSCOLORS": "Gxfxcxdxbxegedabagacad",
"NVM_DIR": "~/.nvm",
"NVM_CD_FLAGS": "-q",
"NVM_NODEJS_ORG_MIRROR": "https://nodejs.org/dist",
"NVM_IOJS_ORG_MIRROR": "https://iojs.org/dist",
"MANPATH": "~/.nvm/versions/node/v12.13.0/share/man:/usr/local/share/man:/usr/share/man:/opt/X11/share/man:/Library/Apple/usr/share/man:/Library/Frameworks/Mono.framework/Versions/Current/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man",
"NVM_PATH": "~/.nvm/versions/node/v12.13.0/lib/node",
"NVM_BIN": "~/.nvm/versions/node/v12.13.0/bin",
"rvm_prefix": "~",
"rvm_path": "~/.rvm",
"rvm_bin_path": "~/.rvm/bin",
"rvm_version": "1.29.9 (latest)",
"GEM_HOME": "~/.rvm/gems/ruby-2.6.5",
"GEM_PATH": "~/.rvm/gems/ruby-2.6.5:~/.rvm/gems/ruby-2.6.5@global",
"MY_RUBY_HOME": "~/.rvm/rubies/ruby-2.6.5",
"IRBRC": "~/.rvm/rubies/ruby-2.6.5/.irbrc",
"RUBY_VERSION": "ruby-2.6.5",
"rvm_alias_expanded": "",
"rvm_bin_flag": "",
"rvm_delete_flag": "0",
"rvm_docs_type": "",
"rvm_file_name": "",
"rvm_gemstone_package_file": "",
"rvm_gemstone_url": "",
"rvm_niceness": "",
"rvm_nightly_flag": "",
"rvm_only_path_flag": "",
"rvm_pretty_print_flag": "",
"rvm_proxy": "",
"rvm_quiet_flag": "",
"rvm_ruby_alias": "",
"rvm_ruby_bits": "",
"rvm_ruby_file": "",
"rvm_ruby_make": "",
"rvm_ruby_make_install": "",
"rvm_ruby_mode": "",
"rvm_script_name": "",
"rvm_sdk": "",
"rvm_silent_flag": "",
"rvm_sticky_flag": "",
"rvm_system_flag": "",
"rvm_use_flag": "",
"rvm_user_flag": "",
"rvm_ruby_string": "ruby-2.6.5",
"_": "<YOUR RAILS DIRECTORY>/bin/webpack",
"RAILS_ENV": "development",
"NODE_ENV": "development",
"BUNDLE_GEMFILE": "<YOUR RAILS DIRECTORY>/Gemfile",
"BUNDLER_ORIG_BUNDLE_BIN_PATH": "BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL",
"BUNDLER_ORIG_BUNDLE_GEMFILE": "<YOUR RAILS DIRECTORY>/Gemfile",
"BUNDLER_ORIG_BUNDLER_VERSION": "BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL",
"BUNDLER_ORIG_GEM_HOME": "~/.rvm/gems/ruby-2.6.5",
"BUNDLER_ORIG_GEM_PATH": "~/.rvm/gems/ruby-2.6.5:~/.rvm/gems/ruby-2.6.5@global",
"BUNDLER_ORIG_MANPATH": "~/.nvm/versions/node/v12.13.0/share/man:/usr/local/share/man:/usr/share/man:/opt/X11/share/man:/Library/Apple/usr/share/man:/Library/Frameworks/Mono.framework/Versions/Current/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man",
"BUNDLER_ORIG_PATH": "~/.rvm/gems/ruby-2.6.5/bin:~/.rvm/gems/ruby-2.6.5@global/bin:~/.rvm/rubies/ruby-2.6.5/bin:~/.rvm/bin:/usr/local/opt/imagemagick@6/bin:~/.nvm/versions/node/v12.13.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands",
"BUNDLER_ORIG_RB_USER_INSTALL": "BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL",
"BUNDLER_ORIG_RUBYLIB": "BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL",
"BUNDLER_ORIG_RUBYOPT": "BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL",
"BUNDLE_BIN_PATH": "~/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/exe/bundle",
"BUNDLER_VERSION": "2.1.4",
"RUBYOPT": "-r~/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib/bundler/setup",
"RUBYLIB": "~/.rvm/gems/ruby-2.6.5/gems/bundler-2.1.4/lib"
}
}
},
{
"key": "CaseSensitivePaths",
"value": {
"options": {},
"logger": {},
"pathCache": {},
"fsOperations": 0,
"primed": false
}
},
{
"key": "MiniCssExtract",
"value": {
"options": {
"filename": "css/[name]-[contenthash:8].css",
"ignoreOrder": false,
"chunkFilename": "css/[name]-[contenthash:8].chunk.css"
}
}
},
{
"key": "Manifest",
"value": {}
}
],
"config": {
"mode": "development",
"output": {
"filename": "js/[name]-[contenthash].js",
"chunkFilename": "js/[name]-[contenthash].chunk.js",
"hotUpdateChunkFilename": "js/[id]-[hash].hot-update.js",
"path": "<YOUR RAILS DIRECTORY>/public/packs",
"publicPath": "/packs/",
"pathinfo": true
},
"resolve": {
"extensions": [
".mjs",
".js",
".sass",
".scss",
".css",
".module.sass",
".module.scss",
".module.css",
".png",
".svg",
".gif",
".jpeg",
".jpg"
],
"plugins": [
{
"topLevelLoader": {}
}
]
},
"resolveLoader": {
"modules": [
"node_modules"
],
"plugins": [
{}
]
},
"node": {
"dgram": "empty",
"fs": "empty",
"net": "empty",
"tls": "empty",
"child_process": "empty"
},
"cache": true,
"devtool": "cheap-module-source-map",
"devServer": {
"clientLogLevel": "none",
"compress": true,
"quiet": false,
"disableHostCheck": true,
"host": "localhost",
"port": 3035,
"https": false,
"hot": false,
"contentBase": "<YOUR RAILS DIRECTORY>/public/packs",
"inline": true,
"useLocalIp": false,
"public": "localhost:3035",
"publicPath": "/packs/",
"historyApiFallback": {
"disableDotRule": true
},
"headers": {
"Access-Control-Allow-Origin": "*"
},
"overlay": true,
"stats": {
"entrypoints": false,
"errorDetails": true,
"modules": false,
"moduleTrace": false
},
"watchOptions": {
"ignored": [
"**/node_modules/**",
"vendor/**"
]
}
},
"optimization": {
"splitChunks": {
"chunks": "all",
"name": false
},
"runtimeChunk": true
}
},
"entry": {
"application": "<YOUR RAILS DIRECTORY>/app/javascript/packs/application.js",
"initialize": "<YOUR RAILS DIRECTORY>/app/javascript/packs/initialize.js",
"login_styles": "<YOUR RAILS DIRECTORY>/app/javascript/packs/login_styles.js",
"styles": "<YOUR RAILS DIRECTORY>/app/javascript/packs/styles.js"
},
"resolvedModules": [
{
"key": "source",
"value": "<YOUR RAILS DIRECTORY>/app/javascript"
},
{
"key": "vendor/keen/dist",
"value": "<YOUR RAILS DIRECTORY>/vendor/keen/dist"
},
{
"key": "app/assets",
"value": "<YOUR RAILS DIRECTORY>/app/assets"
},
{
"key": "node_modules",
"value": "node_modules"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment