Skip to content

Commit

Permalink
Initial commit with Embroider
Browse files Browse the repository at this point in the history
- Need beta version of Ember CSS Modules.
See salsify/ember-css-modules#140 (comment)
- Need full path because of our settings.
See salsify/ember-css-modules@251a2d9#diff-04c6e90faac2675aa89e2176d2eec7d8R160
- Build seems to work, but when you actually visit localhost:4200, you
get a Fastboot-related error.
  • Loading branch information
tansongyang committed Oct 24, 2019
1 parent e9b0437 commit da8e287
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 39 deletions.
13 changes: 8 additions & 5 deletions app/components/grid-demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from '@ember/component';
import styles from './grid-demo-styles';
import styles from 'app/components/grid-demo-styles';
import { loadCss } from '../utils/lazy-css-load';

export default class GridDemoComponent extends Component {
Expand All @@ -22,15 +22,18 @@ export default class GridDemoComponent extends Component {
columnDefs: [
{ headerName: 'Make', field: 'make' },
{ headerName: 'Model', field: 'model' },
{ headerName: 'Price', field: 'price' }
{ headerName: 'Price', field: 'price' },
],
rowData: [
{ make: 'Toyota', model: 'Celica', price: 35000 },
{ make: 'Ford', model: 'Mondeo', price: 32000 },
{ make: 'Porsche', model: 'Boxter', price: 72000 }
]
{ make: 'Porsche', model: 'Boxter', price: 72000 },
],
};
this.gridInstance = new grid.Grid(this.element.querySelector('.grid-container'), gridOptions);
this.gridInstance = new grid.Grid(
this.element.querySelector('.grid-container'),
gridOptions
);
}

willDestroyElement() {
Expand Down
17 changes: 7 additions & 10 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function (defaults) {
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
'asset-cache': {
include: ['assets/**/*', 'ag-grid.css'],
},
'esw-cache-fallback': {
patterns: [
'/lighthouse-results\\.*'
],
patterns: ['/lighthouse-results\\.*'],
},
babel: {
plugins: [require.resolve('ember-auto-import/babel-plugin')]
plugins: [require.resolve('ember-auto-import/babel-plugin')],
},
cssModules: {
includeExtensionInModulePath: true,
},
prember: {
urls: [
'/',
]
}
urls: ['/'],
},
});

// Use `app.import` to add additional libraries to the generated
Expand All @@ -38,5 +34,6 @@ module.exports = function (defaults) {
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

return app.toTree();
const { Webpack } = require('@embroider/webpack');
return require('@embroider/compat').compatBuild(app, Webpack);
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"devDependencies": {
"@ember/edition-utils": "^1.1.1",
"@ember/optional-features": "^1.0.0",
"@embroider/compat": "^0.7.1",
"@embroider/core": "^0.7.1",
"@embroider/webpack": "^0.7.1",
"@glimmer/component": "^0.14.0-alpha.12",
"ag-grid-community": "^21.2.2",
"babel-eslint": "^10.0.2",
Expand All @@ -41,7 +44,7 @@
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-sri": "^2.1.1",
"ember-cli-uglify": "^3.0.0",
"ember-css-modules": "^1.2.1",
"ember-css-modules": "1.3.0-beta.1",
"ember-data": "~3.13.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^2.0.0",
Expand Down
Loading

0 comments on commit da8e287

Please sign in to comment.