Skip to content

Commit

Permalink
Merge pull request #704 from pulibrary/mathjs
Browse files Browse the repository at this point in the history
Update Webpacker/MathJS
  • Loading branch information
sdellis committed Dec 26, 2017
2 parents 4101932 + cf550f3 commit 3dad267
Show file tree
Hide file tree
Showing 6 changed files with 697 additions and 416 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gem "sprockets", ">= 3.0.0"
gem "title"
gem "uglifier"
gem "valkyrie", git: "https://github.com/samvera-labs/valkyrie.git"
gem 'webpacker', '3.0.2'
gem 'webpacker', '3.2.0'

group :development do
gem "foreman"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ GEM
rack (>= 1.2.0)
rack-protection (2.0.0)
rack
rack-proxy (0.6.2)
rack-proxy (0.6.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -764,7 +764,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
webpacker (3.0.2)
webpacker (3.2.0)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
Expand Down Expand Up @@ -855,7 +855,7 @@ DEPENDENCIES
valkyrie!
web-console
webmock
webpacker (= 3.0.2)
webpacker (= 3.2.0)

BUNDLED WITH
1.15.4
2 changes: 2 additions & 0 deletions config/webpack/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { environment } = require('@rails/webpacker')
const vue = require('./loaders/vue')
environment.loaders.append('vue', vue)

module.exports = environment
13 changes: 13 additions & 0 deletions config/webpack/loaders/vue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { dev_server: devServer } = require('@rails/webpacker').config

const isProduction = process.env.NODE_ENV === 'production'
const inDevServer = process.argv.find(v => v.includes('webpack-dev-server'))
const extractCSS = !(inDevServer && (devServer && devServer.hmr)) || isProduction

module.exports = {
test: /\.vue(\.erb)?$/,
use: [{
loader: 'vue-loader',
options: { extractCSS }
}]
}
Loading

0 comments on commit 3dad267

Please sign in to comment.