-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate the css pipeline to webpack (#1550)
* first commit to migrate css pipeline to webpack. fa icons dont work * add newlines and rm link tag * fix font awesome w/ a hack * rm dev deps * moved entire asset directory by accident * rm images from mistaken dir
- Loading branch information
Showing
26 changed files
with
1,084 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
// FIXME: taken from https://github.com/rails/webpacker/issues/2140 | ||
// can't seem to get anything else to respond to the root url /pun/<thing>/<app> | ||
// so let's open this config up and redefine those things. We don't use or care about WEBPACKER_ASSET_HOST | ||
if (process.env.RAILS_RELATIVE_URL_ROOT || process.env.WEBPACKER_RELATIVE_URL_ROOT) { | ||
const config = require('@rails/webpacker/package/config'); | ||
const path = require('path'); | ||
const root = process.env.WEBPACKER_RELATIVE_URL_ROOT || process.env.RAILS_RELATIVE_URL_ROOT || '/'; | ||
config.publicPath = path.join(root, `${config.public_output_path}/`); | ||
config.publicPathWithoutCDN = path.join(root, `${config.public_output_path}/`); | ||
} | ||
|
||
const { environment } = require('@rails/webpacker'); | ||
const config = environment.toWebpackConfig(); | ||
const { merge } = require('webpack-merge'); | ||
|
||
config.resolve.alias = { | ||
jquery: 'jquery/src/jquery', | ||
fa: '/app/javascript/packs/fa', | ||
batchConnect: '/apps/javascript/packs/batchConnect' | ||
} | ||
}; | ||
|
||
const faPath = "~@fortawesome/fontawesome-free/webfonts/"; | ||
const sassOptions = { | ||
additionalData: `$fa-font-path: '${faPath}';`, | ||
sourceMap: true, | ||
}; | ||
|
||
const SASSLoader = environment.loaders.get('sass').use.find(el => el.loader === 'sass-loader'); | ||
SASSLoader.options = merge(SASSLoader.options, sassOptions); | ||
|
||
module.exports = environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.