Skip to content

Commit

Permalink
don't pass frontend build files through babel
Browse files Browse the repository at this point in the history
since we're on node 6.6 now, we don't need
babel for anything we were using it for in our
frontend build/webpack code that runs on node.
(except for es6 import/export)

Change-Id: I41352fdc8adb06fe1585565f63d808d249f92864
Reviewed-on: https://gerrit.instructure.com/91573
Reviewed-by: Simon Williams <[email protected]>
Tested-by: Jenkins
Product-Review: Ryan Shaw <[email protected]>
QA-Review: Ryan Shaw <[email protected]>
  • Loading branch information
ryankshaw committed Nov 8, 2016
1 parent 1307ba8 commit 6421818
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 20 deletions.
1 change: 1 addition & 0 deletions frontend_build/baseWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var bundleEntries = require("./bundles");
var BundleExtensionsPlugin = require("./BundleExtensionsPlugin");
var WebpackOnBuildPlugin = require('on-build-webpack');
var path = require('path');
require('babel-polyfill')

module.exports = {
devtool: 'eval',
Expand Down
22 changes: 11 additions & 11 deletions frontend_build/i18nLinerHandlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
// compilation to extract i18nliner scopes, and then we wrap the resulting
// template in an AMD module, giving it dependencies on handlebars, it's scoped
// i18n object if it needs one, and any brandableCss variant stuff it needs.
import Handlebars from 'handlebars'
import {pick} from 'lodash'
import {EmberHandlebars} from 'ember-template-compiler'
import ScopedHbsExtractor from './../gems/canvas_i18nliner/js/scoped_hbs_extractor'
import {allFingerprintsFor} from 'brandable_css/lib/main'
import PreProcessor from './../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor'
import './../gems/canvas_i18nliner/js/scoped_hbs_pre_processor'
const Handlebars = require('handlebars')
const {pick} = require('lodash')
const {EmberHandlebars} = require('ember-template-compiler')
const ScopedHbsExtractor = require('./../gems/canvas_i18nliner/js/scoped_hbs_extractor')
const {allFingerprintsFor} = require('brandable_css/lib/main')
const PreProcessor = require('./../gems/canvas_i18nliner/node_modules/i18nliner-handlebars/dist/lib/pre_processor')
require('./../gems/canvas_i18nliner/js/scoped_hbs_pre_processor')

const compileHandlebars = (data) => {
const path = data.path
Expand Down Expand Up @@ -123,14 +123,14 @@ const buildPartialRequirements = (partialPaths) => {
return requirements
}

export default function i18nLinerHandlebarsLoader (source) {
module.exports = function i18nLinerHandlebarsLoader (source) {
this.cacheable()
const name = resourceName(this.resourcePath)
const dependencies = ['handlebars']

var partialRegistration = emitPartialRegistration(this.resourcePath, name)
const partialRegistration = emitPartialRegistration(this.resourcePath, name)

var cssRegistration = buildCssReference(name)
const cssRegistration = buildCssReference(name)
if (cssRegistration){
// arguments[1] will be brandableCss
dependencies.push('compiled/util/brandableCss')
Expand All @@ -149,6 +149,6 @@ export default function i18nLinerHandlebarsLoader (source) {
if (result.translationCount > 0) {
dependencies.push('i18n!' + result.scope)
}
var compiledTemplate = emitTemplate(this.resourcePath, name, result, dependencies, cssRegistration, partialRegistration)
const compiledTemplate = emitTemplate(this.resourcePath, name, result, dependencies, cssRegistration, partialRegistration)
return compiledTemplate
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
"webpack": "webpack --progress --color --watch",
"webpack-development": "webpack --progress --color",
"webpack-stats": "webpack --profile --json",
"webpack-test": "NODE_ENV=test webpack --progress --color --config webpack.test.config.babel.js",
"webpack-test-ember": "NODE_ENV=test WEBPACK_TEST_BUNDLE=ember webpack --progress --color --config webpack.test.config.babel.js",
"webpack-test-watch": "NODE_ENV=test webpack --progress --color --watch --config webpack.test.config.babel.js",
"webpack-production": "NODE_ENV=production webpack --progress --color --config webpack.production.config.babel.js"
"webpack-test": "NODE_ENV=test webpack --progress --color --config webpack.test.config.js",
"webpack-test-ember": "NODE_ENV=test WEBPACK_TEST_BUNDLE=ember webpack --progress --color --config webpack.test.config.js",
"webpack-test-watch": "NODE_ENV=test webpack --progress --color --watch --config webpack.test.config.js",
"webpack-production": "NODE_ENV=production webpack --progress --color --config webpack.production.config.js"
}
}
3 changes: 0 additions & 3 deletions webpack.config.babel.js

This file was deleted.

1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./frontend_build/baseWebpackConfig')
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'babel-polyfill'
var webpack = require("webpack");
var baseWebpackConfig = require("./frontend_build/baseWebpackConfig");
var productionWebpackConfig = baseWebpackConfig;
Expand Down
1 change: 0 additions & 1 deletion webpack.test.config.babel.js → webpack.test.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'babel-polyfill'
var webpack = require("webpack");
var I18nPlugin = require("./frontend_build/i18nPlugin");
var ClientAppsPlugin = require("./frontend_build/clientAppPlugin");
Expand Down

0 comments on commit 6421818

Please sign in to comment.