Skip to content

Instantly share code, notes, and snippets.

/content.js Secret

Created August 24, 2016 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/67ebc824e609de5e904fac126f2021dd to your computer and use it in GitHub Desktop.
Save anonymous/67ebc824e609de5e904fac126f2021dd to your computer and use it in GitHub Desktop.
//var webpack = require("webpack");
var $ = require("jquery");
function exportHtml(){
$(document).ready(function(){
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "./node_modules/bootstrap/dist/css/bootstrap.min.css";
$("head").append(css);
var css2 = document.createElement("link");
css2.type = "text/css";
css2.rel = "stylesheet";
css2.href = "./src/css/style.css";
$("head").append(css2);
$("body").load("./src/mainContainer.html", function(){
$(".main_container .row").append("<strong>Success</strong>");
});
});
}
module.exports = exportHtml();
// Same as app.js -- The “entry point” is where your application will start, and where webpack will start tracking dependencies between modules. //
//require("!style!css!../css/style.css");
//require("!style!css!bootstrap/dist/css/bootstrap.min.css");
document.write(require("./content.js"));
<div class="main_container container-fluid" id="main">
<div class="row">
</div>
</div>
var webpack = require("webpack");
module.exports = {
entry: [
"./src/js/entry.js"
],
output: {
filename: 'app.bundle.js',
path: "./build"
},
module: {
loaders : [
// { test: /\.css$/, loader: ["style-loader","css-loader"]},
{ test: /\.(woff2?|svg|jpe?g|png|gif|ico)$/, loader: 'url?limit=10000' },
{ test: /\.(ttf|eot)$/, loader: 'file' }
// { test: /!bootstrap.+\.(jsx|js)$/, loader: 'imports?jQuery=jquery,$=jquery,this=>window' }
]
}
/* plugins: [
new webpack.ProvidePlugin({
...
})
]
*/
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment