Skip to content

Commit 3f6d334

Browse files
Create main.js for require project; defined paths for plugins
1 parent ac7b5d7 commit 3f6d334

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

build-require.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
({
2+
appDir: 'src/js',
3+
baseUrl: './',
4+
dir: 'dist/js/',
5+
mainConfigFile: 'src/js/main.js',
6+
optimize: 'uglify', // "none": No minification, "uglify": Full minification
7+
modules: [
8+
{
9+
name: 'main',
10+
include: ['vendor/require']
11+
},
12+
]
13+
})

src/js/main.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
(function() {
3+
require.config({
4+
baseUrl: '/js',
5+
paths: {
6+
async: 'vendor/async',
7+
depend: 'vendor/depend',
8+
font: 'vendor/font',
9+
goog: 'vendor/goog',
10+
image: 'vendor/image',
11+
json: 'vendor/json',
12+
mdown: 'vendor/mdown',
13+
noext: 'vendor/noext',
14+
propertyParser: 'vendor/propertyParser',
15+
mdConverter: 'vendor/Markdown.Converter',
16+
text: 'vendor/text',
17+
18+
domReady: 'vendor/domReady',
19+
jquery: 'vendor/jquery.min',
20+
jqEasing: 'vendor/jquery.easing.min',
21+
classList: 'vendor/classList',
22+
underscore: 'vendor/underscore-min',
23+
24+
modernizr: 'vendor/modernizr',
25+
},
26+
shim: {
27+
jquery: { exports: '$' },
28+
jqEasing: { deps: ['jquery'] },
29+
underscore: { exports: '_' },
30+
modernizr: { exports: 'Modernizr' },
31+
}
32+
});
33+
34+
require([
35+
36+
]);
37+
}).call(this);

0 commit comments

Comments
 (0)