Comments (6)
Do you see an Unexpected token .
error? I think this happens because of this. I import xx from 'x.html';
and want to use it like that: let foo = { xx }
. Which I guess compiles to something like var foo = { xx: xx.default }
from html-loader.
Hi, thanks for replying. I would like to show you the code(Angular 2):
source:
import TabsHtmls from './bi-tabs.html';
@Component({
selector: 'bi-tabs',
template: TabsHtmls, // need to be string
styles: [".bi-tabs{background-color:red}"],
directives: [ROUTER_DIRECTIVES],
})
build :
var bi_tabs_html_1 = __webpack_require__(352);
var BiTabs = (function () {
function BiTabs() {
}
__decorate([
core_1.Input(),
__metadata('design:type', Array)
], BiTabs.prototype, "biTabsConfigs", void 0);
BiTabs = __decorate([
core_1.Component({
selector: 'bi-tabs',
template: bi_tabs_html_1.default, // default
styles: [".bi-tabs{background-color:red}"],
directives: [router_1.ROUTER_DIRECTIVES],
}),
__metadata('design:paramtypes', [])
], BiTabs);
return BiTabs;
})();
/* 352 */
/***/ function(module, exports, __webpack_require__) {
module.e = "<div\n hello\n</div>";
/***/ }
from html-loader.
looks like this PR does it #97
it's already merged
from html-loader.
cool...can you publish a new npm version so we can easily use this feature?
from html-loader.
@sokra can
from html-loader.
looking forward to it!
from html-loader.
Related Issues (20)
- How to trigger re-compile if partial changed? HOT 4
- when to publish tag on 'fix(getOptions): deprecation change' HOT 1
- Style attribute with expansion variable is omitted when minimized HOT 2
- Favicon: Module not found HOT 5
- After upgrading from v1.3.2 to v2.1.2, <%= require("html-loader!x.html") %> is not available. HOT 1
- Parse errors with html content containing < HOT 4
- this.getOptions is not a function HOT 1
- params “source: false” is falied HOT 2
- remove documentation of use cases involving extract-loader HOT 4
- When extending default sources, tag is not optional HOT 1
- Emits seperate js file even when target is `webworker` and max chunks is 1 HOT 7
- Readd root as webpack resolve.roots does not allow conditionally resolve HOT 3
- Possibility to extend default 'minimize' options HOT 7
- require(...) is not a function - PostHTML HOT 1
- David and HTML Loader badges are broken HOT 5
- ignoring noscript HOT 9
- DIfferent behavior in development and production modes HOT 1
- Two Created Files HOT 1
- Webpack 5 output.clean deletes loaded resources on rebuild HOT 2
- HTML comments don't show up correctly in the documentation on webpack.js.org HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-loader.