Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
ti-ember-webpack-resolver
Advanced tools
An Ember.js resolver heavily inspired by https://github.com/stefanpenner/ember-jj-abrams-resolver but mainly for use with webpack.
npm install ember-webpack-resolver --save-dev
This resolver is intended to resolve modules with a folder structure like such:
| - app/
| --- components/
| --- controllers/
| --- models/
| --- routes/
| --- templates/
| --- views/
| --- app.js
| --- router.js
| - node_modules/
| --- some-widget-ember-component
| ----- index.js
| ----- index.hbs
| - bower_components/
| --- some-other-ember-component
| ----- index.js
| ----- index.hbs
A very simple config will resolve just your local modules:
var App = Ember.Application.create({
Resolver: require('ember-webpack-resolver?' + __dirname)()
});
If you're using a file extension other than .js
, supply the lookup extensions such use with coffeescript:
var App = Ember.Application.create({
Resolver: require('ember-webpack-resolver?' + __dirname)({
extensions: ['.coffee', '.hbs']
})
});
If you have a custom module type that you need to resolve, use the lookupPatterns
option. It takes an array of functions with each function receiving a parsedName
argument. The function optionally returns a moduleName
value based on some criteria.
var reactModuleFilter = function(parsedName) {
if (parsedName.type === 'react') {
return './react/' + parsedName.fullNameWithoutType
}
}
var App = Ember.Application.create({
Resolver: require('ember-webpack-resolver?' + __dirname)({
extensions: ['.coffee', '.hbs'],
lookupPatterns: [reactModuleFilter]
})
});
If you want to also resolve modules within vendor folders, a bit more configuration is required:
var App = Ember.Application.create({
Resolver: require('ember-webpack-resolver?' + __dirname)({
components: {
'some-widget': require('some-widget-ember-component'),
'other-widget': require('some-other-ember-component')
}
})
});
Then it will resolve to the specified module when inserted into your template:
<h1>{{some-widget value="Hooray!"}}</h1>
<p>{{#other-widget}}Stuff{{/other-widget}}</p>
To resolve modules within the bower_components
folder, be sure to add the folder to your webpack config:
module.exports = {
// ...
resolve: {
moduleDirectories: ["node_modules", "bower_components"]
}
};
lookupPatterns
.Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.
FAQs
An Ember resolver for use with webpack
The npm package ti-ember-webpack-resolver receives a total of 4 weekly downloads. As such, ti-ember-webpack-resolver popularity was classified as not popular.
We found that ti-ember-webpack-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.